-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Compile time calc() in CSS #1607
Comments
I agree that this would be nice to do, although not top priority. I have been slowly implementing more and more CSS minification cases over time so this is in scope. It's a pretty complex feature however, so maybe basic cases could be added first and then support for more cases could be added over time. I assume the test cases and code for postcss-calc and the calc specification would be appropriate references. It looks like postcss-calc has correctness bugs though so care would have to be taken when choosing what specific simplifications to do in esbuild. |
Sorry, please don't do this, for the specific reasons I have written here: #1821 |
A percentage is not always a constant value, as its value depends on the context. On the other hand, |
Example:
Since these calculations have const values, it would be possible to just calculate it and output:
Is this something esbuild could/should do as part of the minification?
The text was updated successfully, but these errors were encountered: