Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty style node emitted if no styles #539

Open
arsduo opened this issue Jul 22, 2021 · 1 comment
Open

Empty style node emitted if no styles #539

arsduo opened this issue Jul 22, 2021 · 1 comment

Comments

@arsduo
Copy link

arsduo commented Jul 22, 2021

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.

@rtfeldman
Copy link
Owner

Happy to accept a PR for this! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants