-
Notifications
You must be signed in to change notification settings - Fork 934
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
USWDS - Core: Remove commented code from utility builder #5209
USWDS - Core: Remove commented code from utility builder #5209
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to remove them if we're not using. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels safe to remove. The render-media-queries mixin no longer exists in the code base, and this code block was commented out 3 years ago.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw a major reduction in the file size of the project 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little change, big effect
Summary
Reduce size of compiled CSS when comments aren't explicitly excluded.
Problem statement
When compiling USWDS without optimization configured to remove comments, the output includes 1500 instances of the following snippet of code (one for each utility class):
This unnecessarily inflates the size of the compiled output, and may cause extra work for the compilation itself.
Solution
Remove unused code.
Testing and review
Before: 1336223 bytes (1336.2kb)
After: 657293 bytes (657.3kb)
Diff: 678930 bytes (-50.8%)