arowM/elm-mixin/2.0.0

NOTE: the latest version is 5.3.0

Mixin

A brief module for Mixins.

Core

type Mixin msg

Similar to Html.Attribute msg but more flexible and reusable.

fromAttributes : List (Attribute msg) -> Mixin msg
toAttributes : Mixin msg -> List (Attribute msg)
batch : List (Mixin msg) -> Mixin msg
none : Mixin msg

Nodes

(List (Attribute msg) -> List (Html msg) -> Html msg)
-> List (Mixin msg)
-> List (Html msg)
-> Html msg

Lift nodes to take Mixins instead of Attributes.

import Html
import Mixin


view : Html msg
view =
    Mixin.lift Html.form
        [ Mixin.class "foo"
        ]
        []

Common nodes

node : String -> List (Mixin msg) -> List (Html msg) -> Html msg
div : List (Mixin msg) -> List (Html msg) -> Html msg
span : List (Mixin msg) -> List (Html msg) -> Html msg

Attributes

fromAttribute : Attribute msg -> Mixin msg

Common attributes

attribute : String -> String -> Mixin msg
class : String -> Mixin msg
id : String -> Mixin msg