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 Sidebar: experiment with a persistent vertical display #38465

Closed
wants to merge 2 commits into from
Closed
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
11 changes: 4 additions & 7 deletions packages/edit-site/src/components/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ function Editor( { onError } ) {
const {
isInserterOpen,
isListViewOpen,
sidebarIsOpened,
settings,
entityId,
templateType,
Expand Down Expand Up @@ -205,13 +204,11 @@ function Editor( { onError } ) {
<InterfaceSkeleton
labels={ interfaceLabels }
secondarySidebar={ secondarySidebar() }
sidebar={
sidebarIsOpened && (
<ComplementaryArea.Slot scope="core/edit-site" />
)
}
drawer={
<NavigationSidebar.Slot />
<>
<NavigationSidebar.Slot />
<ComplementaryArea.Slot scope="core/edit-site" />
</>
}
header={
<Header
Expand Down
2 changes: 0 additions & 2 deletions packages/edit-site/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
__experimentalPreviewOptions as PreviewOptions,
} from '@wordpress/block-editor';
import { useSelect, useDispatch } from '@wordpress/data';
import { PinnedItems } from '@wordpress/interface';
import { _x, __ } from '@wordpress/i18n';
import { listView, plus } from '@wordpress/icons';
import { Button, ToolbarItem } from '@wordpress/components';
Expand Down Expand Up @@ -177,7 +176,6 @@ export default function Header( {
openEntitiesSavedStates={ openEntitiesSavedStates }
isEntitiesSavedStatesOpen={ isEntitiesSavedStatesOpen }
/>
<PinnedItems.Slot scope="core/edit-site" />
<MoreMenu />
</div>
</div>
Expand Down
5 changes: 2 additions & 3 deletions packages/edit-site/src/components/header/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ $header-toolbar-min-width: 335px;
justify-content: space-between;

body.is-fullscreen-mode & {
padding-left: 60px;
transition: padding-left 20ms linear;
transition-delay: 80ms;
@include reduce-motion("transition");
Expand Down Expand Up @@ -65,10 +64,10 @@ body.is-navigation-sidebar-open {
.edit-site-header__toolbar {
display: flex;
align-items: center;
padding-left: $grid-unit-10;
padding-left: $grid-unit-20;

@include break-small() {
padding-left: $grid-unit-30;
padding-left: $grid-unit-20;
}

@include break-wide() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

.edit-site-navigation-panel__site-title-container {
height: $header-height;
padding-left: $header-height;
padding-left: $grid-unit-30;
margin: 0 $grid-unit-20 0 $grid-unit-10;
display: flex;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import {
__unstableMotion as motion,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { wordpress } from '@wordpress/icons';
import { navigation, wordpress } from '@wordpress/icons';
import { store as coreDataStore } from '@wordpress/core-data';
import { useReducedMotion } from '@wordpress/compose';
import { PinnedItems } from '@wordpress/interface';

/**
* Internal dependencies
Expand Down Expand Up @@ -98,6 +99,8 @@ function NavigationToggle( { icon } ) {
>
{ buttonIcon }
</Button>
<Button icon={ navigation } iconSize={ 24 } />
<PinnedItems.Slot scope="core/edit-site" />
</motion.div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@
background: $gray-900;
border-radius: 0;
display: flex;
position: absolute;
z-index: z-index(".edit-site-navigation-toggle");
height: $header-height;
width: $header-height;
flex-direction: column;

button {
color: $white;
}
}

.edit-site-navigation-toggle__button {
align-items: center;
background: $gray-900;
border-radius: 0;
color: $white;
height: $header-height + $border-width;
width: $header-height;
z-index: 1;
Expand All @@ -33,30 +36,6 @@
&:focus {
box-shadow: none;
}

&::before {
transition: box-shadow 0.1s ease;
@include reduce-motion("transition");
content: "";
display: block;
position: absolute;
top: 9px;
right: 9px;
bottom: 9px;
left: 9px;
border-radius: $radius-block-ui + $border-width + $border-width;
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) $gray-900;
}

// Hover color.
&:hover::before {
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) $gray-700;
}

// Lightened spot color focus.
&:focus::before {
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) rgba($white, 0.1), inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
}
}

.edit-site-navigation-toggle__site-icon {
Expand All @@ -68,3 +47,7 @@
margin-top: -($border-width);
}
}

.edit-site-navigation-toggle .interface-pinned-items {
flex-direction: column-reverse;
}
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,8 @@ html.interface-interface-skeleton__html-container {
bottom: 0;
}
}

.interface-interface-skeleton__drawer {
background: $gray-900;
display: flex;
}