diff --git a/packages/edit-post/src/components/header/document-title/index.js b/packages/edit-post/src/components/header/document-actions/index.js similarity index 73% rename from packages/edit-post/src/components/header/document-title/index.js rename to packages/edit-post/src/components/header/document-actions/index.js index 619fa4ef29014..52df978e2cd5b 100644 --- a/packages/edit-post/src/components/header/document-title/index.js +++ b/packages/edit-post/src/components/header/document-actions/index.js @@ -19,7 +19,7 @@ import { displayShortcut } from '@wordpress/keycodes'; */ import { store as editPostStore } from '../../../store'; -function DocumentTitle() { +function DocumentActions() { const { template, isEditing } = useSelect( ( select ) => { const { isEditingTemplate, getEditedPostTemplate } = select( editPostStore ); @@ -46,24 +46,26 @@ function DocumentTitle() { } return ( -
- - - - +
+ -
); } -export default DocumentTitle; +export default DocumentActions; diff --git a/packages/edit-post/src/components/header/document-title/style.scss b/packages/edit-post/src/components/header/document-actions/style.scss similarity index 64% rename from packages/edit-post/src/components/header/document-title/style.scss rename to packages/edit-post/src/components/header/document-actions/style.scss index e39ecf607e430..7eb77f9c0bd88 100644 --- a/packages/edit-post/src/components/header/document-title/style.scss +++ b/packages/edit-post/src/components/header/document-actions/style.scss @@ -1,4 +1,4 @@ -.edit-post-document-title { +.edit-post-document-actions { display: flex; align-items: center; gap: $grid-unit; @@ -13,13 +13,21 @@ border-radius: 4px; width: min(100%, 450px); - &:hover { - color: currentColor; - background: $gray-200; + .components-button { + &:hover { + color: var(--wp-block-synced-color); + background: $gray-200; + } } } -.edit-post-document-title__title.components-button { +.edit-post-document-actions__command { + flex-grow: 1; + color: var(--wp-block-synced-color); + overflow: hidden; +} + +.edit-post-document-actions__title { flex-grow: 1; color: var(--wp-block-synced-color); overflow: hidden; @@ -28,34 +36,29 @@ color: var(--wp-block-synced-color); } + .block-editor-block-icon { + flex-shrink: 0; + } + h1 { - color: var(--wp-block-synced-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + color: var(--wp-block-synced-color); } } -.edit-post-document-title__shortcut { - flex-shrink: 0; - color: $gray-700; - padding: 0 $grid-unit-15; - - &:hover { - color: $gray-700; - } +.edit-post-document-actions__shortcut { + color: $gray-800; } -.edit-post-document-title__left { +.edit-post-document-actions__back.components-button.has-icon.has-text { min-width: $button-size; flex-shrink: 0; + color: $gray-700; + gap: 0; - .components-button.has-icon.has-text { - color: $gray-700; - gap: 0; - - &:hover { - color: currentColor; - } + &:hover { + color: currentColor; } } diff --git a/packages/edit-post/src/components/header/index.js b/packages/edit-post/src/components/header/index.js index 9c9462a641dd3..ab4bbd4bbc5d1 100644 --- a/packages/edit-post/src/components/header/index.js +++ b/packages/edit-post/src/components/header/index.js @@ -18,7 +18,7 @@ import { default as DevicePreview } from '../device-preview'; import ViewLink from '../view-link'; import MainDashboardButton from './main-dashboard-button'; import { store as editPostStore } from '../../store'; -import DocumentTitle from './document-title'; +import DocumentActions from './document-actions'; const slideY = { hidden: { y: '-50px' }, @@ -60,8 +60,8 @@ function Header( { setEntitiesSavedStatesCallback } ) { className="edit-post-header__toolbar" > -
- +
+
{ event.stopPropagation(); onBack(); diff --git a/packages/edit-site/src/components/header-edit-mode/document-actions/style.scss b/packages/edit-site/src/components/header-edit-mode/document-actions/style.scss index d26bbdaf28ff6..dd442264e6398 100644 --- a/packages/edit-site/src/components/header-edit-mode/document-actions/style.scss +++ b/packages/edit-site/src/components/header-edit-mode/document-actions/style.scss @@ -1,7 +1,9 @@ .edit-site-document-actions { - display: grid; - grid-template-columns: 1fr 2fr 1fr; + display: flex; + align-items: center; + gap: $grid-unit; height: $button-size; + justify-content: space-between; // 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. @@ -10,11 +12,12 @@ background: $gray-100; border-radius: 4px; width: min(100%, 450px); - overflow: hidden; - &:hover { - color: currentColor; - background: $gray-200; + .components-button { + &:hover { + color: var(--wp-block-synced-color); + background: $gray-200; + } } @include break-medium() { @@ -27,21 +30,23 @@ } .edit-site-document-actions__command { - grid-column: 1 / -1; - display: grid; - grid-template-columns: 1fr 2fr 1fr; - grid-row: 1; + flex-grow: 1; + color: var(--wp-block-synced-color); + overflow: hidden; } - .edit-site-document-actions__title { flex-grow: 1; color: var(--wp-block-synced-color); overflow: hidden; - grid-column: 2 / 3; + + &:hover { + color: var(--wp-block-synced-color); + } .block-editor-block-icon { min-width: $grid-unit-30; + flex-shrink: 0; } h1 { @@ -70,26 +75,21 @@ } } -.edit-site-document-actions__shortcut, -.edit-site-document-actions__back { - color: $gray-800; - - .edit-site-document-actions:hover & { - color: $gray-900; - } -} - .edit-site-document-actions__shortcut { - text-align: right; + color: $gray-800; } -.edit-site-document-actions__back { +.edit-site-document-actions__back.components-button.has-icon.has-text { min-width: $button-size; flex-shrink: 0; - grid-column: 1 / 2; - grid-row: 1; + color: $gray-700; + gap: 0; z-index: 1; + &:hover { + color: currentColor; + } + .edit-site-document-actions.is-animated & { animation: edit-site-document-actions__slide-in-left 0.3s; @include reduce-motion("animation");