-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Navigation block overlay padding zero clamp calculation fails for zero values #61398
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
[Block] NavigationAffects the Navigation BlockAffects the Navigation Block[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
The padding on the navigation responsive container is calculated using a clamp function.
The clamp calculation uses the --wp--style--root--padding-xyz - which fails when any of the units are set to zero (0)
Our site don't require a value for top or bottom.
padding:
clamp(1rem, var(--wp--style--root--padding-top), 20rem) //<-- is zero
clamp(1rem, var(--wp--style--root--padding-right), 20rem)
clamp(1rem, var(--wp--style--root--padding-bottom), 20rem) // <-- is zero
clamp(1rem, var(--wp--style--root--padding-left), 20em);
Step-by-step reproduction instructions
- Go the the Style editor > Layout
- Set top and bottom to zero
- open the responsive menu container on mobile
- calc function fails - no padding applied

Screenshots, screen recording, code snippet
No response
Environment info
WordPress 6.5.2 running our Custom block theme
Gutenberg - Version 18.2.0
Mac/Windows, iOS
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Block] NavigationAffects the Navigation BlockAffects the Navigation Block[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for Bug.