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

Center the document title #59134

Merged
merged 7 commits into from
Mar 22, 2024
Merged
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
45 changes: 28 additions & 17 deletions packages/edit-site/src/components/header-edit-mode/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
$header-toolbar-min-width: 335px;

.edit-site-header-edit-mode {
height: $header-height;
align-items: center;
Expand All @@ -16,46 +14,62 @@ $header-toolbar-min-width: 335px;
display: flex;
border: none;
align-items: center;
flex-grow: 1;
flex-shrink: 2;
// We need this to be overflow hidden so the block toolbar can
// overflow scroll. If the overflow is visible, flexbox allows
// the toolbar to grow outside of the allowed container space.
overflow: hidden;
// Take up the full height of the header so the border focus
// is visible on toolbar buttons.
height: 100%;
// Allow focus ring to be fully visible on furthest right button.
@include break-medium() {
// Account for the site hub, which is 60x60px.
flex-basis: calc(37.5% - 60px);
padding-right: 2px;
// We need this to be overflow hidden so the block toolbar can
// overflow scroll. If the overflow is visible, flexbox allows
// the toolbar to grow outside of the allowed container space.
overflow: hidden;
}
}

.edit-site-header-edit-mode__end {
display: flex;
justify-content: flex-end;
height: 100%;
flex-grow: 1;
flex-shrink: 1;

@include break-medium() {
flex-basis: 37.5%;
}
}

.edit-site-header-edit-mode__center {
display: flex;
align-items: center;
height: 100%;
display: flex;
flex-basis: 100%;
flex-grow: 1;
margin: 0 $grid-unit-20;
flex-shrink: 2;
height: 100%;
justify-content: center;

// Flex items will, by default, refuse to shrink below a minimum
// intrinsic width. In order to shrink this flexbox item, and
// subsequently truncate child text, we set an explicit min-width.
// See https://dev.w3.org/csswg/css-flexbox/#min-size-auto
min-width: 0;

@include break-medium() {
flex-basis: 25%;
}
}

}

.edit-site-header-edit-mode__toolbar {
display: flex;
align-items: center;
padding-left: $grid-unit-20;
display: flex;
gap: $grid-unit-10;
padding-left: $grid-unit-20;

@include break-medium() {
padding-left: $grid-unit-50 * 0.5;
Expand Down Expand Up @@ -87,12 +101,9 @@ $header-toolbar-min-width: 335px;
display: inline-flex;
align-items: center;
flex-wrap: nowrap;
padding-right: $grid-unit-05;

@include break-small () {
padding-right: $grid-unit-10;
}

// Ensure actions do not press against .edit-site-header-edit-mode__center.
padding-left: $grid-unit-10;
padding-right: $grid-unit-10;
gap: $grid-unit-10;
}

Expand Down
10 changes: 5 additions & 5 deletions packages/editor/src/components/document-bar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
min-width: 0;
background: $gray-100;
border-radius: $grid-unit-05;
width: min(100%, 450px);
width: min(100%, 416px);

&:hover {
background-color: $gray-200;
Expand Down Expand Up @@ -46,8 +46,8 @@
align-items: center;

// Offset the layout based on the width of the ⌘K label. This ensures the title is centrally aligned.
@include break-small() {
padding-left: $grid-unit-40;
@include break-medium() {
padding-left: $grid-unit-30;
}

&:hover {
Expand All @@ -67,14 +67,14 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 50%;
max-width: 70%;
color: currentColor;
}
}

.editor-document-bar__shortcut {
color: $gray-800;
min-width: $grid-unit-40;
min-width: $grid-unit-30;
display: none;

@include break-medium() {
Expand Down
13 changes: 3 additions & 10 deletions packages/editor/src/components/document-tools/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
align-items: center;

// Hide all action buttons except the inserter on mobile.
.editor-document-tools__left > .components-button {
.editor-document-tools__left > .editor-history__redo,
.editor-document-tools__left > .editor-history__undo {
display: none;

@include break-small() {
@include break-medium() {
display: inline-flex;
}
}
Expand Down Expand Up @@ -70,14 +71,6 @@
// Some plugins add buttons here despite best practices.
// Push them a bit rightwards to fit the top toolbar.
margin-right: $grid-unit-10;

@include break-medium() {
padding-left: $grid-unit-50 * 0.5;
}

@include break-wide() {
padding-right: $grid-unit-10;
}
}

.editor-document-tools .editor-document-tools__left > .editor-document-tools__inserter-toggle.has-icon {
Expand Down
3 changes: 1 addition & 2 deletions packages/interface/src/components/pinned-items/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
&[aria-controls="edit-post:document"],
&[aria-controls="edit-post:block"],
&[aria-controls="edit-site:template"],
&[aria-controls="edit-site:block-inspector"],
&[aria-controls="edit-site:global-styles"] {
&[aria-controls="edit-site:block-inspector"] {
display: flex;
}

Expand Down
Loading