-
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
Global Styles: Elements: Captions text color not respected in front end. #42054
Comments
One suggestion is that this could be expected behaviour, since the theme is opting in to opinionated styles using the theme support (add_theme_support( 'wp-block-styles' );) If we go this route then:
@WordPress/block-themers - does this approach make sense to you? |
I fully expect to stop using wp-block-styles. The main reason why I still use it is because of the .has-background padding, not the captions. I'd happily get rid of it completely but I don't know how to solve it for older themes. |
Not using I think those things that are more generally helpful and opinionated, though not currently configurable (like .has-background padding which is a great example) should instead be surfaced another way (as a configurable block attribute or added in the theme's CSS). |
See also the comment here: #41140 (comment) |
I'm closing this on the understanding that we expect the opinionated block styles to override the styles set in theme.json. |
Is it really logicall that theme.json overrides all but one specific stylesheet? |
Just ran into this issue with Gallery > Image font sizes. Even drilling down with both of these options, and they are still overruled for gallery images: "core/gallery": {
"elements": {
"caption": {
"typography": {
"fontSize": "var( --wp--preset--font-size--sm )"
}
}
}
},
"core/image": {
"elements": {
"caption": {
"typography": {
"fontSize": "var( --wp--preset--font-size--sm )"
}
}
}
} |
Since the load order of global styles CSS was changed this is no longer an issue. |
Description
When I try to set the caption text color, the CSS overwrites it, when a theme opts in to opinionated styles.
This happens when theme opt in to opinionated CSS, using the
wp-block-styles
theme support:add_theme_support( 'wp-block-styles' );
To solve this we should move this CSS into the block.json file so that the user settings override it. However this is complex because the CSS comes from the theme.css file, not the standard block file. We might need to introduce a new key to block.json for opinionated block styles.
cc @adamziel @draganescu @getdave
Step-by-step reproduction instructions
elements
. Note that the text should be white:Screenshots, screen recording, code snippet
Environment info
No response
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: