-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
"global-styles-inline-css" outputs colours, gradients etc not used/defined in theme.json #39442
Comments
Hi @landwire Thanks for adding your input; In summary, as far as I understand: the default color palette is still loaded so those variables can by other plugins in the WordPress Ecosystem (as explained at #24684 (comment)) Regarding the duotones and gradients: There is a lot of active work going on figuring out how and what should be dequeued by default; and it's not quite all figured out yet; you can catch up with discussion at starting with #38681 (comment) and later comments in there. |
What is the problem with this: /**
* DISABLE GUTENBERG STYLE
*/
add_action( 'wp_enqueue_scripts', function() {
wp_dequeue_style( 'global-styles' );
}, 100 ); |
Disabling the 'global-styles' may suit your needs if you're using a 'classic' WordPress theme which all PHP (or perhaps some javascript) (without a theme.json file). If you are using theme.json in a 'classic' theme or a block theme; then you'll run into many issues. What this issue requests is the ability to not load those default colors, duotones, and gradients that are not defined in theme.json. |
I love classic themes and see no benefits in anything other |
Description
global-styles-inline-css prints many colours, gradients, duotone and background/borders etc that are not defined in theme.json.
Expected behaviour would be that the global-styles-inline-css only outputs what is defined in theme.json and not some random other colours, gradients etc.
If that is on purpose then it would be good to let us opt out of this. I do not mean opt out of global-styles in general, which I know is possible, as I like my font-sizes, colour palette etc generated inside global-styles-inline-css, but opt-out of those default colours, gradients etc. that are not even defined in my theme.json and therefore do not have the possibility to choose those colours/gradients.
Step-by-step reproduction instructions
Example theme.json:
Small part of the generated CSS! I have only defined 4 colours, no gradients and no duotones:
Screenshots, screen recording, code snippet
No response
Environment info
Wordpress 5.9.2 & Gutenberg 12.7.2
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: