-
Notifications
You must be signed in to change notification settings - Fork 61
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
core: attribute selectors with comma not working #377
Comments
That indeed a bug, can be reproed in our sandbox, too. griffel/packages/core/src/runtime/compileCSS.ts Lines 35 to 44 in 31bb221
The function above is probably the source of the problem. (I hope that such CSS rules are not used in real products are they will cause performance issues). |
Thank you @layershifter ! I would definitely not use such rules in normal conditions. But sometimes, for complex and legacy apps that could be a good workaround. |
It will be noticeable if an app has a big DOM tree. In general: .foo [style*="color: red"] { color: pink }
(Use Edge with enabled paint instrumentation) Note1: That selector will affect only elements that have inline styles, so it might not be so bad, but it still impacts performance |
When using nested attribute selectors that contains commas, they generate incorrect styles, inserting ampersands after the comma.
For example:
will result in something like
See more in this Codesandbox.
The text was updated successfully, but these errors were encountered: