-
Notifications
You must be signed in to change notification settings - Fork 4.4k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
[v4] Tailwind generates a lot of unused styles #16571
Comments
Efforts are underway to clear unused CSS variables and Also, as per #16211 (comment):
|
@wongjn is there a way to control that? I do want to generate all CSS variables with |
Sorry, what are you referring to when you ask if there is any "way to control that"? |
Yes, consider reading the Always including all variables section in #16211 (assuming the same API would be reimplemented). |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Steps to reproduce
@import "tailwindcss";
.npm run build
command.Expected result
The generated CSS file should contain only essential styles, such as CSS resets, with a file size of approximately 2 KB.
Actual result
The generated CSS file includes a significant number of unused styles, with a total size of 21.8 KB.
utilities
styles,@keyframes
rules,@property
rules.Workaround
PurgeCSS can remove most of the unused styles, except for
@property
rules:With this configuration, the final CSS file size is reduced to approximately 4 KB.
The text was updated successfully, but these errors were encountered: