diff --git a/packages/edit-navigation/src/components/editor/style.scss b/packages/edit-navigation/src/components/editor/style.scss index bce96deb1515a..eaa1ae7e3221e 100644 --- a/packages/edit-navigation/src/components/editor/style.scss +++ b/packages/edit-navigation/src/components/editor/style.scss @@ -3,7 +3,12 @@ border: $border-width solid $gray-900; border-radius: $radius-block-ui; max-width: $navigation-editor-width; - margin: auto; + margin: $grid-unit-40 auto 0 auto; + + @include break-medium() { + // Provide space for the floating block toolbar. + margin-top: $grid-unit-50 * 2; + } .editor-styles-wrapper { padding: 0; diff --git a/packages/edit-navigation/src/components/header/index.js b/packages/edit-navigation/src/components/header/index.js index c923caf5b1767..49cf4cb972f53 100644 --- a/packages/edit-navigation/src/components/header/index.js +++ b/packages/edit-navigation/src/components/header/index.js @@ -38,14 +38,12 @@ export default function Header( { return (
-
-

- { __( 'Navigation' ) } -

-

- { isMenuSelected && actionHeaderText } -

-
+

+ { __( 'Navigation' ) } +

+

+ { isMenuSelected && actionHeaderText } +

{ isMenuSelected && (
} sidebar={ - ( hasPermanentSidebar || - hasSidebarEnabled ) && ( + hasSidebarEnabled && ( ) } @@ -190,7 +179,6 @@ export default function Layout( { blockEditorSettings } ) { onSelectMenu={ selectMenu } onDeleteMenu={ deleteMenu } isMenuBeingDeleted={ isMenuBeingDeleted } - hasPermanentSidebar={ hasPermanentSidebar } /> ) } diff --git a/packages/edit-navigation/src/components/layout/style.scss b/packages/edit-navigation/src/components/layout/style.scss index 9689f2ecc1385..0d84561fc19a8 100644 --- a/packages/edit-navigation/src/components/layout/style.scss +++ b/packages/edit-navigation/src/components/layout/style.scss @@ -34,45 +34,14 @@ // Reference element for the block popover position. position: relative; - // The 10px match that of similar settings pages. - padding: $grid-unit-15 10px 10px 10px; - - @include break-medium() { - // Provide space for the floating block toolbar. - padding-top: $navigation-editor-spacing-top; - } - // Ensure the entire layout is full-height, the background // of the editing canvas needs to be full-height for block // deselection to work. flex-grow: 1; } - .interface-interface-skeleton__header { - border-bottom-color: transparent; - } - - // Force the sidebar to the right side of the screen on larger - // breakpoints. - &.has-permanent-sidebar .interface-interface-skeleton__sidebar { - position: fixed !important; - top: $grid-unit-40; - right: 0; - bottom: 0; - left: auto; - - // Hide the toggle as the sidebar should be permanently open. - .edit-navigation-sidebar__panel-tabs > button { - display: none; - } - } - .edit-navigation-header { background: $white; - - @include break-medium() { - background: transparent; - } } } diff --git a/packages/edit-navigation/src/components/sidebar/index.js b/packages/edit-navigation/src/components/sidebar/index.js index 4123ef911e146..c6301230b1e58 100644 --- a/packages/edit-navigation/src/components/sidebar/index.js +++ b/packages/edit-navigation/src/components/sidebar/index.js @@ -13,6 +13,7 @@ import { ComplementaryArea, store as interfaceStore, } from '@wordpress/interface'; +import { useViewportMatch } from '@wordpress/compose'; /** * Internal dependencies @@ -29,8 +30,8 @@ export default function Sidebar( { isMenuBeingDeleted, onDeleteMenu, onSelectMenu, - hasPermanentSidebar, } ) { + const isLargeViewport = useViewportMatch( 'medium' ); const { sidebar, hasBlockSelection, hasSidebarEnabled } = useSelect( ( select ) => { const _sidebar = select( @@ -79,10 +80,10 @@ export default function Sidebar( { scope={ SIDEBAR_SCOPE } identifier={ sidebarName } icon={ cog } - isActiveByDefault={ hasPermanentSidebar } + isActiveByDefault={ isLargeViewport } header={ } headerClassName="edit-navigation-sidebar__panel-tabs" - isPinnable={ ! hasPermanentSidebar } + isPinnable > { sidebarName === SIDEBAR_MENU && ( <>