Closed
Description
openedon Jun 19, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment