NoRedInk/noredink-ui/4.10.0

NOTE: this package is not compatible with Elm 0.19.1

Nri.Ui.Styles.V1

Simplifies using elm-css in modules that expose views

Creating namespaces stylesheets

type alias Styles id class msg =
StylesWithAssets id class msg ()
  • css: The resulting stylesheets to add to Nri.Ui.Css.Site
  • id, class, classList: The Html.Attribute helper functions
type alias StylesWithAssets id class msg assets =
{ css : assets -> List Stylesheet
, id : id -> Attribute msg
, class : List class -> Attribute msg
, classList : List ( class, Bool ) -> Attribute msg
, div : class -> List (Html msg) -> Html msg
, span : class -> List (Html msg) -> Html msg
}

Styles that depend on assets, for instance because they use a background image somewhere.

styles : String -> List Snippet -> Styles id class msg

Use this instead of Html.CssHelpers. This will help you make sure you don't mismatch the namespace you're using.

{ css, class } =
    Nri.Ui.Styles.styles "Nri-Ui-MyWidget-"
        [ Css.Foreign.class Container
            [ backgroundColor Nri.Ui.Colors.V1.ochre ]
        ]
stylesWithExtraStylesheets : String -> List Stylesheet -> List Snippet -> Styles id class msg

Use this instead of styles if you need to include Stylesheets from external packages, or if you need to add styles without a namespace. Remember, all stylesheets given here will be included on all pages of the site.

String
-> (assets -> List Snippet)
-> StylesWithAssets id class msg assets

Use this if your styles depend on asset files

Helpers for CSS

Keyframe animations

A CSS keyframe animation that will have vendor prefixes automatically added.

keyframes : String -> List ( String, String ) -> Keyframe

Create a CSS keyframe animation with appropriate vendor prefixes

toString : Keyframe -> String

Turn a Keyframe into a string that can be included in a CSS stylesheet.