-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Priority] HighUsed to indicate top priority items that need quick attentionUsed to indicate top priority items that need quick attention[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
If you have applied styles to specific elements in theme.json, perhaps blocks as well, there is a chance that they will be overridden by default block styles. I have not had a chance to test this issue widely, but I discovered (with the help of @bgardner) that the element styles in theme.json for Image block captions are no longer respected in 6.6.
Take a look at the screenshots below. You will see that the specificity changes in #61638 seem to have swapped the style order. This causes the block style to override theme.json. In my opinion, theme.json should always "beat" default block styles.
Step-by-step reproduction instructions
- Use the Twenty Twenty-Four theme and WordPress 6.6 Beta 3+
- Add an image with a caption to the page
- In
theme.json, add the following to the caption element
"spacing": {
"margin": {
"top": "10px",
"bottom": "0"
}
}
- View the image on the front end and see that the block styles override for margin override those set in the theme.json
Screenshots, screen recording, code snippet
| WordPress 6.5 | WordPress 6.6 |
|---|---|
![]() |
![]() |
Environment info
- WordPress 6.6 Beta 3+
- Gutenberg 18.5
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Priority] HighUsed to indicate top priority items that need quick attentionUsed to indicate top priority items that need quick attention[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for issues without a type.

