-
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
Style engine: add optimize flag and combine functions into wp_style_engine_get_stylesheet #42878
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.
Nice one, thanks for the quick follow-up. I like the merging of wp_style_engine_get_stylesheet_from_css_rules()
and wp_style_engine_add_to_store()
👍, just left a comment on your naming comment, but I don't feel too strongly about which way we go there. I'll be curious to see what @aristath thinks 🙂
Re-tested that Layout and Elements supports are still working correctly, and the optimize
flag looks good to me.
LGTM!
packages/style-engine/phpunit/class-wp-style-engine-processor-test.php
Outdated
Show resolved
Hide resolved
Adding tests Updating comments
…e_engine_add_to_store()` into `wp_style_engine_get_stylesheet()`
fbe9d11
to
680ac22
Compare
…et_from_css_rules Formatting tests for readability
680ac22
to
5b288e9
Compare
Tagged for the changelog. |
What?
A follow up to:
This PR:
WP_Style_Engine_Processor->get_css()
which allows for bypassing the selector combination optimizeationwp_style_engine_get_stylesheet_from_css_rules()
andwp_style_engine_add_to_store()
intowp_style_engine_get_stylesheet()
Why and how?
Testing Instructions
For the optimize flag:
For the merged function:
Example
The frontend should appear as expected:
The styles should be output correctly:
gutenberg_get_layout_style() should return the compiled CSS for the single block only (and not the cumulated stylesheet)