Skip to content
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

Lost spacing between horizontal navigation menu items following PR 29465 #30065

Closed
bobbingwide opened this issue Mar 21, 2021 · 3 comments
Closed
Labels
[Block] Navigation Affects the Navigation Block CSS Styling Related to editor and front end styles, CSS-specific issues. [Type] Regression Related to a regression in the latest release

Comments

@bobbingwide
Copy link
Contributor

Description

On updating to Gutenberg 10.2.0 I noticed that the padding between horizontal menu items had been reduced to 0 pixels.
In PR #29465, there was a CSS change to packages/block-library/src/navigation/style.scss, that reduced the padding to 0;

.wp-block-navigation {
	// Normalize list styles.
	ul,
	ul li {
		list-style: none;

		// Overrides generic ".entry-content li" styles on the front end.
		padding: 0;
	}
}

The inline CSS overrides my theme's stylesheet.

What is the recommended method that enables me to style the menu for the front end?

Step-by-step reproduction instructions

  1. Install Gutenberg 10.1.1
  2. Using an FSE theme such as Fizzie or TT1 blocks style navigation links with a background colour and padding between the links.
  3. Upgrade from Gutenberg 10.1.1 to 10.2.0
  4. Notice the spacing between the menu items disappearing.

Expected behaviour

I should be able to style horizontal navigation menu items on the front end with spacing between individual items.
image

Actual behaviour

When I updated to Gutenberg 10.2.0 the padding was reduced to 0.
I don't know the correct way to resolve this.

Screenshots or screen recording (optional)

image

For more details see bobbingwide/fizzie#26

Code snippet (optional)

WordPress information

Device information

  • Device: Desktop
  • Operating system: Windows 10
  • Browser: Chrome and Firefox
@bobbingwide
Copy link
Contributor Author

TT1 blocks with the link's background colour set to white and padding-right set to 10px;
image

The same without the padding.
image

@bobbingwide
Copy link
Contributor Author

I believe I've found the solution.

.wp-block-navigation ul li {
   padding-right: 4px;
}

This works beause the theme stylesheet comes after the block's inline CSS.
I didn't need !important. I just had to target the same selector as the inline CSS.

If this explanation is correct then the issue can be closed Invalid / Wontfix.

@skorasaurus skorasaurus added [Type] Regression Related to a regression in the latest release CSS Styling Related to editor and front end styles, CSS-specific issues. labels Mar 26, 2021
@skorasaurus skorasaurus added the [Block] Navigation Affects the Navigation Block label Mar 15, 2023
@jordesign
Copy link
Contributor

I can no longer recreate this - so will close the issue as not-needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block CSS Styling Related to editor and front end styles, CSS-specific issues. [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

No branches or pull requests

3 participants