close
Skip to content

Navigation block overlay padding zero clamp calculation fails for zero values #61398

@djcowan

Description

@djcowan

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

  1. Go the the Style editor > Layout
  2. Set top and bottom to zero
  3. open the responsive menu container on mobile
  4. calc function fails - no padding applied
    zero

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] NavigationAffects the Navigation Block[Type] BugAn existing feature does not function as intended

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions