rtfeldman / elm-css

Typed CSS in Elm.
https://package.elm-lang.org/packages/rtfeldman/elm-css/latest
BSD 3-Clause "New" or "Revised" License
1.23k stars 196 forks source link

fix: setting styles with attribute for svg elements #565

Closed Confidenceman02 closed 2 years ago

Confidenceman02 commented 2 years ago

fixes #564

Context

17.0.4 fixed a bug that was causing DOM exceptions by changing the way we were updating styles to use VirtualDom.attribute "class" ... instead of VirtualDom.property "className" ....

This was due to svg elements not liking the property "className" method which is a known phenomenon in the html spec.

Some random stack overflow post that is probably true: https://stackoverflow.com/questions/43750395/how-to-add-a-class-in-a-svg-element-circle-using-javascript

However, whilst the pesky exception was fixed there were some unintended side effects you can read about in this issue #564.

Work completed

The above changes focus on only fixing what was breaking, rather than changing the implementation for all elements.

Styled examples showing svg and html elements with their respective class properties.

NS

Confidenceman02 commented 2 years ago

Happy to merge and release @rtfeldman.