Repository navigation
Description
Description
There have been several reports floating around trying to describe this, but more keep arising, so I'm hoping this report can help centralize the issue a bit. In short:
The List Block's default styles and added Global Styles are also applying to other blocks in both the editor and the live site. On the live site, the symptoms present when a post contains a List block, but the editor shows symptoms even without the list block present.
Step-by-step reproduction instructions
- Activate TT3 and set the default home template
- Open Site Editor, and create a navigation menu with a submenu included
- Open Global Styles > Blocks > List block, and apply a custom color to the TEXT and BACKGROUND fields
- Save changes and view the site
- Return to the editor and add a List block to the template somewhere.
- Save changes and view the site again.
Screenshots, screen recording, code snippet
Global Styles > Blocks > List Block > Text Color impacts blocks in editor
listblockstyles-part1-compressed.mp4
Text Color - Impacted blocks in editor:
- Post Featured Image (overlay)
- Post Excerpt
Text Color - Impacted blocks in live site:
- None
Adding List Block to template brings those symptoms and more to the live site
listblockstyles-part2-compressed.mp4
Text Color - Impacted blocks in editor:
- Post Featured Image (overlay)
- Post Excerpt
Text Color - Impacted blocks in live site:
- Navigation Block
- Post Excerpt
List block impacting the padding of the submenu (#49445)
listblockstyles-part3.mov
Padding - Impacted blocks in editor:
- None
Padding - Impacted blocks in live site:
- Navigation block (submenu)
Adding a Background color to Global Styles > Blocks > List Block
listblockstyles-part4.mov
BG Color - Impacted blocks in editor:
- None
BG Color - Impacted blocks in live site:
- Navigation Block
Removing the List block from the template removes all symptoms from live site
listblockstyles-part5.mov
Environment info
- WordPress 6.2
- Gutenberg 15.7.1
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
Projects
- StatusShow more project fieldsDone
Activity
juanfra commentedon May 11, 2023
Thanks for sharing!
I think one is pretty much related to what's also happening with the paragraph block styles.
The list block is not using a
wp-block-*class, affecting any other list present on the site. To solve this, we'll need to use a class for the list block and keep the modified styles just for that class (something similar to what I proposed in my PR for the paragraph block, or this other approach).jamiepalatnik commentedon Jun 22, 2023
I ran into this issue as well and ended up using custom CSS as a workaround to remove extra padding added to the Navigation block.
donalirl commentedon Jun 25, 2023
I used the following CSS to address this, until the bug can be fixed:
simonwammerfors commentedon Jun 28, 2023
I've also run into a similar issue. In my case I've set the font-size for the navigation in theme.json. On pages with the list block present however, inline CSS belonging to that block overrides the font-size for the navigation.
iamtakashi commentedon Jul 25, 2023
I've also run into this issue. In my case, list elements with a background colour had an unexpected style when I set paddings to the list block because of this CSS added to it. The target seems to be too broad.
Steps to reproduce this.
iamtakashi commentedon Aug 15, 2023
Just saw another unwanted effect in the editor caused by these "too-broad" selectors from Global Styles.
.editor-styles-wrapper ol, .editor-styles-wrapper ulOnce you change the horizontal padding for the list block, the post template that uses list item breaks. Notice the misalignment of the posts. They should remain unchanged by changing the padding change in the list block.
jordesign commentedon Sep 12, 2023
Just noting that we're seeing mentions of this in the Support Forums as well.
aleone89 commentedon Sep 19, 2023
Another report of this here: https://wordpress.com/forums/topic/navigation-menu-appearance-varies/?view=all#post-3989938
annezazu commentedon Sep 21, 2023
@ellatrix flagging this for you.
4 remaining items
Fix issue with local nav height
talldan commentedon Nov 27, 2023
This issue seems to be a duplicate of the much older issue #12420. That one has a PR associated with it (#56469).
jordesign commentedon Jan 14, 2024
Another report in the forums:
https://wordpress.org/support/topic/possible-conflict-between-list-block-and-submenu-formatting/?view=all
annezazu commentedon Feb 8, 2024
After a review by core editor triage leads and core editor tech leads, this has been removed from the board for 6.5 consideration.
colorful-tones commentedon Feb 12, 2024
@annezazu did we forget to remove this from the board, or was there a reason we did not, and do you mind providing it please?
annezazu commentedon Feb 12, 2024
Hah! This should have been removed. I bet I was moving too fast. Done.
ellatrix commentedon Mar 1, 2024
Not sure what I can do here. This was introduced in #21387 by @ZebulanStanphill. @ZebulanStanphill, could we change this to use a class? I think it's not right that we're using a tag selector only.
xtremeranger commentedon Jun 12, 2024
Now that the list has a class name (#56469) can the style.scss be edited to fix the issue mentioned in @iamtakashi comment?
EDIT: I spoke too soon, sorry. The change to lower the specificity has already been put in place.
ellatrix commentedon Jul 12, 2024
@carolinan Was this fixed in #56469?
carolinan commentedon Jul 15, 2024
yes, thank you for the reminder. I can confirm that this is solved. (I am using WP 6.6-RC3-58711)