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

Navigation block: fix padding on mobile overlay when global padding is 0 #53725

Merged
merged 4 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/block-library/src/navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,10 @@ button.wp-block-navigation-item__content {
@include reduce-motion("animation");

// Try to inherit any root paddings set, so the X can align to a top-right aligned menu.
padding-top: var(--wp--style--root--padding-top, 2rem);
padding-right: var(--wp--style--root--padding-right, 2rem);
padding-bottom: var(--wp--style--root--padding-bottom, 2rem);
padding-left: var(--wp--style--root--padding-left, 2rem);
padding-top: clamp(1rem, var(--wp--style--root--padding-top), 20rem);
padding-right: clamp(1rem, var(--wp--style--root--padding-right), 20rem);
padding-bottom: clamp(1rem, var(--wp--style--root--padding-bottom), 20rem);
padding-left: clamp(1rem, var(--wp--style--root--padding-left), 20em);

// Allow modal to scroll.
overflow: auto;
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/specs/editor/blocks/navigation-colors.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,10 @@ class ColorControl {
.getByRole( 'button', { name: 'Open menu' } )
.click();

// Move the mouse to avoid accidentally triggering hover
// state on the links once the overlay opens.
await this.page.mouse.move( 1000, 1000 );

const overlay = this.editor.canvas
.locator( '.wp-block-navigation__responsive-container' )
.filter( { hasText: 'Submenu Link' } );
Expand Down
Loading