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: Try making it possible for themes to have the X overlay the = icon #43576

Merged
merged 2 commits into from
Aug 26, 2022
Merged
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
12 changes: 10 additions & 2 deletions packages/block-library/src/navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,11 @@ button.wp-block-navigation-item__content {
flex-direction: column;
background-color: inherit;

// Use em units to apply padding, so themes can more easily style this in various ways.
padding: 2rem;
// 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);

// Allow modal to scroll.
overflow: auto;
Expand Down Expand Up @@ -646,6 +649,11 @@ button.wp-block-navigation-item__content {
.wp-block-navigation__responsive-close {
width: 100%;

// Try to inherit wide-width when defined, so the X can align to a top-right aligned menu.
max-width: var(--wp--style--global--wide-size, 100%);
margin-left: auto;
margin-right: auto;

// This element is not keyboard accessible, and is focusable only using the mouse.
// It is part of the MicroModal library that adds a scrim outside of a modal dialog that is not fullscreen,
// where clicking that scrim closes the overlay just like the close button.
Expand Down