-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
CSS minification combines vendor-specific selectors creating invalid rules #1776
Comments
Additional context:
|
Thanks Evan! Here's another related discussion where this is starting to show up more: tailwindlabs/tailwindcss#6096 |
Merging rules is difficult, as well as DCE (removing unnecessary rules that are covered by other rules below) because of keeping specificity. I've looked for a super CSS minification tool before but each of them have some drawback. We can just turn off this optimization for now, until a better algorithm be found. |
Thank you @evanw! |
Thank you!!! |
If you feed something like this into esbuild's CSS minification:
...you get this output:
This unfortunately breaks the rule completely because Chrome has no idea what
-ms-input-placeholder
is for example and marks the entire rule as invalid and doesn't apply it.In this example, the selectors should not be combined since they can't be combined safely and the output should remain as:
Twitter thread where this surfaced just in case helpful: https://twitter.com/mmmykolas/status/1460249898499166211
Thanks as always for your amazing work on this project! 🙌
The text was updated successfully, but these errors were encountered: