From 84ea21fe7f8f84b65d8aa415eae6104b01617250 Mon Sep 17 00:00:00 2001 From: MaggieCabrera Date: Thu, 23 Mar 2023 11:48:07 +0100 Subject: [PATCH] only control max width when modal is open --- packages/block-library/src/navigation/style.scss | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/block-library/src/navigation/style.scss b/packages/block-library/src/navigation/style.scss index 946472ef95caa4..b0c8748075bdd7 100644 --- a/packages/block-library/src/navigation/style.scss +++ b/packages/block-library/src/navigation/style.scss @@ -689,10 +689,12 @@ 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; + .has-modal-open & { + // 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,