From f3480ebe1b3a558f823e091d6ceca64b73bb8e45 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Mon, 3 Jul 2023 13:09:58 +0200 Subject: [PATCH] Rename post document-title and improve CSS consistency. --- .../index.js | 18 +++++++++------ .../style.scss | 22 +++++++++++++++---- .../edit-post/src/components/header/index.js | 6 ++--- .../src/components/header/style.scss | 2 +- packages/edit-post/src/style.scss | 2 +- .../document-actions/style.scss | 6 ++++- 6 files changed, 39 insertions(+), 17 deletions(-) rename packages/edit-post/src/components/header/{document-title => document-actions}/index.js (83%) rename packages/edit-post/src/components/header/{document-title => document-actions}/style.scss (69%) 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 83% 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 0cbf154ba213c1..52df978e2cd5b3 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,9 +46,9 @@ function DocumentTitle() { } return ( -
+
@@ -78,4 +82,4 @@ function DocumentTitle() { ); } -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 69% 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 f66bc2973a0d2a..7eb77f9c0bd88c 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; @@ -21,10 +21,24 @@ } } -.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; + + &:hover { + color: var(--wp-block-synced-color); + } + + .block-editor-block-icon { + flex-shrink: 0; + } h1 { white-space: nowrap; @@ -34,11 +48,11 @@ } } -.edit-post-document-title__shortcut { +.edit-post-document-actions__shortcut { color: $gray-800; } -.edit-post-document-title__back.components-button.has-icon.has-text { +.edit-post-document-actions__back.components-button.has-icon.has-text { min-width: $button-size; flex-shrink: 0; color: $gray-700; diff --git a/packages/edit-post/src/components/header/index.js b/packages/edit-post/src/components/header/index.js index 3f42d4736f57bb..6705d953c67594 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' }, @@ -65,8 +65,8 @@ function Header( { setEntitiesSavedStatesCallback } ) { className="edit-post-header__toolbar" > -
- +
+