-
Notifications
You must be signed in to change notification settings - Fork 4.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
print minified css for global styles #24924
print minified css for global styles #24924
Conversation
What do you think of using |
Good idea, added an extra check for that. |
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 works nicely, thanks!
Description
For development purposes adding tabs and linebreaks to the generated styles makes sense since it makes things easier to read. But for production and code that is going to be shipped to millions of websites, we should try to minimize our footprint as much as possible.
This PR modifies the generated CSS from global styles so they don't include tabs, spaces, and linebreaks.
Every byte counts.
How has this been tested?
Tested that the same styles get generated and printed, the only thing that changes is whitespace.
Types of changes
Removed whitespace characters from the
gutenberg_experimental_global_styles_resolver_styles
function.Checklist:
My code has proper inline documentation.I've included developer documentation if appropriate.I've updated all React Native files affected by any refactorings/renamings in this PR.