-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
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
- Switch to empty theme
- Add this to the theme.json under
elements
. Note that the text should be white:
"caption": {
"border": {
"color": "grey",
"radius": "10px",
"width": "5px",
"style": "solid"
},
"color": {
"background": "limegreen",
"text": "white"
},
"spacing": {
"padding": "10px"
},
"typography": {
"fontFamily": "sans-serif",
"fontSize": "20px"
}
},
- Add a table block with a caption.
- Notice that in the front end the color of the text on captions is still grey
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
Metadata
Metadata
Assignees
Labels
[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended