x3p0-dev / x3p0-ideas

A new WordPress theme.
GNU General Public License v3.0
52 stars 4 forks source link

[Navigation Submenu] Gutenberg 18.1 reduced specificity breaks styles #9

Open justintadlock opened 5 months ago

justintadlock commented 5 months ago

Spacing, specifically padding in this case, defined for core/navigation-submenu is broken when using Gutenberg 18.1. This PR reduces the specificity of the global styles selector, wrapping everything in :where():

To be fair, the PR in and of itself isn't the issue. The primary problem is the specificity of the Core Navigation block styles zeroing out spacing with a higher specificity: https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/navigation/style.scss#L13-L30

Block library style updates were in included in this PR, but the Navigation block was not included:

Solution

If this is not addressed in Gutenberg/Core before the WP 6.6 release, we'll need to create a settings.custom property to customize the spacing for Navigation Submenu and tie it into a stylesheet with a higher specificity. Users won't be able to customize it globally, but that's par for the course getting this theme to work with the block system.

justintadlock commented 5 months ago

It looks like it at least breaks background and text color styles defined in theme.json too. Needs further investigation.