mbylstra / html-to-elm

An online tool for converting HTML to elm-html. Go to
http://mbylstra.github.io/html-to-elm/
395 stars 23 forks source link

Style attributes not formatted properly #5

Closed mrmurphy closed 8 years ago

mrmurphy commented 8 years ago

Inline styles aren't currently formatted properly.

Input:

<div style="background-color: red;"></div>

Current output

div [ style "background-color: red;" ]
    []

Expected output

div [ style [("background-color", "red") ]
    []

Thanks!

mbylstra commented 8 years ago

Ah, that's something hadn't considered, which would need some parsing to do properly. For now, I'm using

div [ attribute "style" "background-color: red;" ]
    []

which should at least compile

mbylstra commented 8 years ago

I've opened https://github.com/mbylstra/html-to-elm/issues/6 to address an alternative where the style function is used.

mrmurphy commented 8 years ago

Sounds good, thanks!