-
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
Featured Image block: applying styles globally resets the border changes in the editor #48048
Comments
This problem may not be limited to a particular block or a particular style. I have tested it with a group block that has a lot of support. When applied to global styles, I see the following pattern:
588e594e2f25e888eb434fefe165303c.mp4 |
From what I have found, this issue is a bit complicated. I would like to use a group block as an example. You apply a border width to one group block. At this time, the following inline style is applied to the block wrapper: element.style {
border-width: 10px;
} Border isn't displayed unless the gutenberg/packages/block-library/src/common.scss Lines 134 to 148 in bc7ac22
Now apply this style globally. The border style of the group block is moved to the global style and the following selector is generated: .editor-styles-wrapper .wp-block-group {
border-width: 10px;
} However, since the group block no longer has the inline style, the common style ( If you change the border width by even 1px in the global style, the following selector will be generated so that the border will appear again. .editor-styles-wrapper .wp-block-group {
border-top-style: solid;
border-top-width: 11px;
border-right-style: solid;
border-right-width: 11px;
border-bottom-style: solid;
border-bottom-width: 11px;
border-left-style: solid;
border-left-width: 11px;
} ccing @andrewserong @aaronrobertshaw To explore the best approach to fix this problem🙏 |
Thanks for investigating this issue @t-hamano 👍 The reason for the behaviour you noted, where changing the border in global styles resulted in a visible border, is due to some additional global styles logic to ensure a The additional logic to set the border style and therefore generate the extra CSS rule was required because we otherwise don't have anything to select by e.g. the inline style. Once I took a look at the It fixes:
|
Description
When using the apply globally feature with the featured image block, some style options are reset and not properly pushed globally. In particular, it seems border isn't properly moved over but there could be others. This was initially found as part of the FSE Outreach Program's twentieth call for testing:
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
border.reset.mov
Meanwhile, in Styles, there are border changes listed for the post featured image that aren't appearing:
Environment info
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: