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

Block Navigation: Fix the issue where clamp function is not working for 0 value #61697

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

amitraj2203
Copy link
Contributor

What?

Fixes: #61398

Why?

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)

How?

It uses the CSS min function to determine if the value of variable is 0 then it will pick that instead of picking from the clamp function.

Testing Instructions

  1. Go to the Style editor > Layout
  2. Set top and bottom to zero
  3. Go to the frontend of website and open the responsive menu container on mobile view

Testing Instructions for Keyboard

NIL

Screenshots or screencast

image

@amitraj2203 amitraj2203 requested a review from ajitbohra as a code owner May 15, 2024 21:02
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: amitraj2203 <[email protected]>
Co-authored-by: hanneslsm <[email protected]>
Co-authored-by: djcowan <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@amitraj2203 amitraj2203 changed the title Fix the issue where clamp function is not working for 0 value Block Navigation: Fix the issue where clamp function is not working for 0 value May 15, 2024
@getdave getdave added [Type] Bug An existing feature does not function as intended Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code [Block] Navigation Affects the Navigation Block labels Nov 20, 2024
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 Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigation block overlay padding zero clamp calculation fails for zero values
2 participants