elm-css icon indicating copy to clipboard operation
elm-css copied to clipboard

Empty style node emitted if no styles

Open arsduo opened this issue 4 years ago • 1 comments

Because of a weird situation with an unusual legacy UI framework in our Elm code, I noticed that elm-css will emit an empty style node if there are no classes. Generally that's not an issue, but inside a large table where each cell contains some rendered Html.Styled, it noticeably affects the performance of the page.

This is a problem with our code more than elm-css, but it's worth potentially improving the library as well. What do you think of not emitting the style node if the list of styles for a given node is empty? (For instance here and equivalent methods.)

Happy to put up a PR if this seems reasonable.

arsduo avatar Jul 22 '21 15:07 arsduo

Happy to accept a PR for this! 👍

rtfeldman avatar Aug 22 '21 20:08 rtfeldman