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

Update layout / alignment metrics in the Site Editor's "Browse" mode. #49028

Closed
wants to merge 10 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
2 changes: 1 addition & 1 deletion packages/base-styles/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ $admin-sidebar-width-big: 190px;
$admin-sidebar-width-collapsed: 36px;
$modal-min-width: 360px;
$spinner-size: 16px;
$canvas-padding: $grid-unit-30;
$canvas-padding: $grid-unit-20;


/**
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/utils/font-size.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const PRESET_FONT_SIZES = {
caption: 10,
footnote: 11,
largeTitle: 28,
subheadline: 12,
subheadline: 16,
title: 20,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/edit-site/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function Layout() {
} );
const disableMotion = useReducedMotion();
const isMobileViewport = useViewportMatch( 'medium', '<' );
const canvasPadding = isMobileViewport ? 0 : 24;
const canvasPadding = isMobileViewport ? 0 : 16;
const showSidebar =
( isMobileViewport && ! isListPage ) ||
( ! isMobileViewport && ( canvasMode === 'view' || ! isEditorPage ) );
Expand Down
8 changes: 7 additions & 1 deletion packages/edit-site/src/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@
top: 0;
left: 0;
width: calc(100vw - #{$canvas-padding * 2});
height: $header-height;
height: $header-height + 4px;
z-index: z-index(".edit-site-layout__hub");

.edit-site-layout.is-full-canvas.is-edit-mode & {
width: auto;
padding-right: 0;
height: $header-height;

.edit-site-site-hub__view-mode-toggle-container {
height: $header-height;
width: $header-height;
}
}

@include break-medium {
Expand Down
8 changes: 6 additions & 2 deletions packages/edit-site/src/components/sidebar-button/style.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.edit-site-sidebar-button {
color: $gray-200;
.edit-site-sidebar-button.components-button.has-icon {
color: $white;
flex-shrink: 0;
min-width: $grid-unit-40;
width: $grid-unit-40;
height: $grid-unit-40;
padding: $grid-unit-05;

// Focus (resets default button focus and use focus-visible).
&:focus:not(:disabled) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.edit-site-sidebar-navigation-item.components-item {
color: $gray-600;
margin: 0 $grid-unit-05;
padding: $grid-unit-10 $grid-unit-20;
min-height: $grid-unit-50;
border: 0;

&:hover,
&:focus,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.edit-site-sidebar-navigation-screen__description {
margin: 0 0 $grid-unit-40 $grid-unit-20;
margin: 0 $grid-unit-20 $grid-unit-30 $grid-unit-20;
}

.edit-site-sidebar-navigation-screen-navigation-menus__placeholder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
__experimentalHStack as HStack,
__experimentalVStack as VStack,
__experimentalNavigatorToParentButton as NavigatorToParentButton,
__experimentalText as Text,
} from '@wordpress/components';
import { isRTL, __ } from '@wordpress/i18n';
import { chevronRight, chevronLeft } from '@wordpress/icons';
Expand Down Expand Up @@ -52,9 +53,15 @@ export default function SidebarNavigationScreen( {
label={ __( 'Dashboard' ) }
/>
) }
<h2 className="edit-site-sidebar-navigation-screen__title">
<Text
className="edit-site-sidebar-navigation-screen__title"
size="subheadline"
as="h2"
weight="600"
color="white"
>
{ title }
</h2>
</Text>
{ actions }
</HStack>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}

.edit-site-sidebar-navigation-screen__content {
margin: 0 $grid-unit-20 $grid-unit-20 $button-size;
margin: 0 0 $grid-unit-20 0;
color: $gray-600;
}

Expand All @@ -29,17 +29,13 @@
position: sticky;
top: 0;
background: $gray-900;
padding-top: $grid-unit-60 + $header-height;
padding-top: $grid-unit-60 + $header-height + 4px;
box-shadow: 0 $grid-unit-10 $grid-unit-20 $gray-900;
margin-bottom: $grid-unit-10;
padding-bottom: $grid-unit-10;
padding-right: $grid-unit-20;
}

.edit-site-sidebar-navigation-screen__title {
font-size: calc(1.56 * 13px);
line-height: normal;
font-weight: 500;
flex-grow: 1;
color: $white;
margin: 0;
Expand Down
5 changes: 3 additions & 2 deletions packages/edit-site/src/components/sidebar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

.components-navigator-screen {
@include custom-scrollbars-on-hover;
scrollbar-gutter: auto;
}
}

Expand All @@ -18,7 +19,7 @@
overflow-x: unset;
}

.edit-site-sidebar__content > div {
.edit-site-sidebar__content > .components-navigator-screen {
// This matches the logo padding
padding: 0 $grid-unit-15;
padding: 0 $grid-unit-20;
}
8 changes: 2 additions & 6 deletions packages/edit-site/src/components/site-hub/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
}

.edit-site-site-hub__view-mode-toggle-container {
height: $header-height;
width: $header-height;
height: $header-height + 4px;
width: $header-height + 4px;
flex-shrink: 0;
background: $gray-900;
}
Expand All @@ -26,7 +26,3 @@
white-space: nowrap;
overflow: hidden;
}

.edit-site-site-hub__site-title {
margin-left: $grid-unit-05;
}