From 6149584daabde2c7ef7391cc4dfc190e40119cde Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Wed, 28 Jun 2023 15:40:37 +0200 Subject: [PATCH 1/3] Remove redundant shortcut button. --- .../src/components/header/document-title/index.js | 9 +++------ .../src/components/header/document-title/style.scss | 9 ++++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/packages/edit-post/src/components/header/document-title/index.js b/packages/edit-post/src/components/header/document-title/index.js index 619fa4ef29014..7e0e1b6243615 100644 --- a/packages/edit-post/src/components/header/document-title/index.js +++ b/packages/edit-post/src/components/header/document-title/index.js @@ -72,12 +72,9 @@ function DocumentTitle() { { templateTitle } - - ); diff --git a/packages/edit-post/src/components/header/document-title/style.scss b/packages/edit-post/src/components/header/document-title/style.scss index e39ecf607e430..86b868f981f06 100644 --- a/packages/edit-post/src/components/header/document-title/style.scss +++ b/packages/edit-post/src/components/header/document-title/style.scss @@ -37,12 +37,11 @@ } .edit-post-document-title__shortcut { - flex-shrink: 0; - color: $gray-700; - padding: 0 $grid-unit-15; + color: $gray-800; + text-align: right; - &:hover { - color: $gray-700; + .edit-post-document-title__shortcut:hover & { + color: $gray-900; } } From 9c5aaf67a33deb83228bcd6c08b9c98d1b78a86b Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Thu, 29 Jun 2023 09:11:46 +0200 Subject: [PATCH 2/3] Fix focus and hover style and improve consistency. --- .../components/header/document-title/index.js | 22 ++++----- .../header/document-title/style.scss | 32 +++++------- .../document-actions/index.js | 7 +-- .../document-actions/style.scss | 49 +++++++++---------- 4 files changed, 49 insertions(+), 61 deletions(-) diff --git a/packages/edit-post/src/components/header/document-title/index.js b/packages/edit-post/src/components/header/document-title/index.js index 7e0e1b6243615..0cbf154ba213c 100644 --- a/packages/edit-post/src/components/header/document-title/index.js +++ b/packages/edit-post/src/components/header/document-title/index.js @@ -47,18 +47,16 @@ 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 f66bc2973a0d2..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; @@ -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 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" > -
- +
+