mbr/elm-extras/2.2.0

NOTE: the latest version is 3.1.0

Extras.Html.Attributes

Convenience functions for working with Html.Attribute.

none : Attribute msg

Empty attribute.

Useful if need to produce an HTML attribute that evaluates to nothing. Example:

div
    [ if isHidden then
        style [ "display", "none" ]


      else
        none
    ]
    [ text "example" ]

The name is no conincidence, but was chosen to not clash with Extras.Html.nothing.

when : Bool -> Attribute msg -> Attribute msg

Return an attribute when the condition is true and an empty attribute otherwise.

when isActive (class "active")