-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Check wp_theme_has_theme_json in addition to wp_is_block_theme in gutenberg_enqueue_global_styles_custom_css() #52655
Conversation
This is a big change. Please do not merge until testing and performance review has been done. |
This change has a performance overhead, but not a large one. |
The custom CSS feature is meant to be used by the block themes, and the Cc-ing @glendaviesnz; he did more work on this feature than me. |
@Mamaduka If that is the case, why is the |
From memory, the discussions around the custom CSS use in classic versus block themes was around avoiding confusion between the existing customizer custom CSS input and the global styles custom CSS. I don't remember thinking about needing to block this specific use case and can't think of any problems with allowing it - if the performance difference isn't an issue. |
Block themes do not require a theme.json file, I think we need to check for one or the other. |
I didn't know that. So, to allow the use of the "css" prop in classic themes with a theme.json file, should the check be?
|
Can we make a decision here: either ship this or close the issue as won't fix. I personally see no harm in allowing classic themes with theme.json to provide a custom CSS property via theme.json |
I hope this is not wontfixed 🙏. As I explain in #52644, right now, the |
This PR is no longer valid because the |
What?
Replace
wp_is_block_theme
withwp_theme_has_theme_json
ingutenberg_enqueue_global_styles_custom_css()
to make custom css from theme.json work on frontend IN CLASSIC THEMES WITH A THEME.JSON FILE, not only pure block themes.Fixes #52644
I hope this can be fixed for WP6.3
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast