pzavolinsky / elmx

A tiny precompiler that takes an Elm program with embedded HTML and desugars the HTML into elm-html syntax. Elmx is to Elm what React's JSX is to Javascript
MIT License
351 stars 11 forks source link

Attribute spread #11

Closed daig closed 7 years ago

daig commented 7 years ago

The attribute spread example in the live demo seems to be broken

attrsGreeting : List (Attribute msg) -> Html msg
attrsGreeting attrs = <div {:attrs}>Hi</div>

goes to

attrsGreeting : List (Attribute msg) -> Html msg
attrsGreeting attrs = Html.div [(:attrs)] [Html.text "Hi"]

Handling attribute spread would be great for handling styling children natively in elm

pzavolinsky commented 7 years ago

Hi @daig , thanks for finding this bug

I've just pushed a new version that fixes this issue, check elmx@1.0.7, Atom's language-elmx@1.2.8 or the updated the live demo.

Cheers!