Takes a namespace and returns helper functions for id, class, and
classList which work just like their equivalents in elm-html except that
they accept union types and automatically incorporate the given namespace. Also
note that class accepts a List instead of a single element; this is so you
can specify multiple classes without having to call classList passing tuples
that all end in True.
-- Put this before your view code to specify a namespace.
{ id, class, classList } = namespace "homepage"
view =
h1 [ id Hero, class [ Fancy ] ] [ text "Hello, World!" ]
type HomepageIds = Hero | SomethingElse | AnotherId
type HomepageClasses = Fancy | AnotherClass | SomeOtherClass
Takes a namespace and returns helper functions for
id,class, andclassListwhich work just like their equivalents inelm-htmlexcept that they accept union types and automatically incorporate the given namespace. Also note thatclassaccepts aListinstead of a single element; this is so you can specify multiple classes without having to callclassListpassing tuples that all end inTrue.The above would generate this DOM element: