rtfeldman/elm-css/12.0.1

NOTE: this package is not compatible with Elm 0.19.1

DEPRECATED.Css.File

DEPRECATED

Compiling to .css files is deprecated, and support is planned to be removed in a future release (likely sometime in 2018), once Html.Styled has matured sufficiently. The design goal is for elm-css to offer One Way To Do It, and that one way is planned to be Html.Styled!

Css.File

Functions for writing CSS files from elm-css.

type alias Stylesheet =
Stylesheet
stylesheet : List Snippet -> Stylesheet

A stylesheet.

stylesheet
    [ body
        [ width (px 960)
        , color (rgb 7 7 7)
        ]
    ]
List Stylesheet
-> { css : String
, warnings : List String
}

Compile the given stylesheets to a CSS string, or to an error message if it could not be compiled.

(CssFileStructure -> Cmd Never)
-> CssFileStructure
-> CssCompilerProgram

Create a program that compiles an elm-css stylesheet to a CSS file.

import Css.File exposing (CssCompilerProgram, CssFileStructure)
import HomepageCss as Homepage


port files : CssFileStructure -> Cmd msg


fileStructure : CssFileStructure
fileStructure =
    Css.File.toFileStructure
        [ ( "homepage.css", Css.File.compile [ Homepage.css ] ) ]


main : CssCompilerProgram
main =
    Css.File.compiler files fileStructure
List
( String
, { css : String
, warnings : List String
}
)
-> CssFileStructure

Translate a list of filenames and prettyPrint results to a list of tuples suitable for being sent to a port in a Stylesheets.elm file.

type alias CssFileStructure =
List
{ filename : String
, content : String
, success : Bool
}

A description of CSS files that will be created by elm-css.

type alias CssCompilerProgram =
Program Never () Never

A prorgam that compiles a CSS file.

See compiler.

Automatically-generated unique classes

Styles scoped under an automatically-generated class.

uniqueClass : List Style -> UniqueClass

Create a style scoped under an automatically-generated class that is guaranteed to be unique - at least relative to other class names generated using this function!

Note: Use uniqueSvgClass for classes that will be used with SVG elements. These will not work with them!

Styles scoped under an automatically-generated class. Use these for <svg> elements, as they use a different

uniqueSvgClass : List Style -> UniqueSvgClass

Create a style scoped under an automatically-generated class that is guaranteed to be unique - at least relative to other class names generated using this function!

Note: Use uniqueClass for classes that will be used with SVG elements. These will only work with SVGs!