From fe15ce342588d203ebe8b514cc8185775b2acef5 Mon Sep 17 00:00:00 2001 From: Joen Asmussen Date: Tue, 16 Jun 2020 10:13:19 +0200 Subject: [PATCH 01/13] Improve buttongroup. --- packages/components/src/button-group/style.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/src/button-group/style.scss b/packages/components/src/button-group/style.scss index 8ac03a2c21e75..aef701d6194a9 100644 --- a/packages/components/src/button-group/style.scss +++ b/packages/components/src/button-group/style.scss @@ -4,8 +4,8 @@ .components-button { border-radius: 0; display: inline-flex; - color: var(--wp-admin-theme-color); - box-shadow: inset 0 0 0 $border-width var(--wp-admin-theme-color); + color: $dark-gray-primary; + box-shadow: inset 0 0 0 $border-width $dark-gray-primary; & + .components-button { margin-left: -1px; @@ -29,7 +29,7 @@ // The active button should look pressed. &.is-primary { - box-shadow: inset 0 0 0 $border-width var(--wp-admin-theme-color); + box-shadow: inset 0 0 0 $border-width $dark-gray-primary; } } } From a83138601f53ff655f048b09ab27816700f309b4 Mon Sep 17 00:00:00 2001 From: Joen Asmussen Date: Tue, 16 Jun 2020 11:44:07 +0200 Subject: [PATCH 02/13] Polish sidebar header, make close align. --- packages/base-styles/_variables.scss | 2 +- packages/components/src/panel/style.scss | 8 ++++---- .../sidebar/last-revision/style.scss | 3 ++- .../sidebar/settings-header/style.scss | 18 ++---------------- .../src/components/sidebar/style.scss | 14 ++++++++++++-- .../components/post-last-revision/style.scss | 2 +- .../src/components/post-publish-panel/index.js | 4 ++-- packages/icons/src/index.js | 1 + packages/icons/src/library/close-small.js | 12 ++++++++++++ .../complementary-area-header/index.js | 4 ++-- .../complementary-area-header/style.scss | 2 +- 11 files changed, 40 insertions(+), 30 deletions(-) create mode 100644 packages/icons/src/library/close-small.js diff --git a/packages/base-styles/_variables.scss b/packages/base-styles/_variables.scss index b0286b7587e1c..07867513d6e53 100644 --- a/packages/base-styles/_variables.scss +++ b/packages/base-styles/_variables.scss @@ -41,7 +41,7 @@ $grid-unit-60: 6 * $grid-unit; // 48px $icon-size: 24px; $button-size: 36px; $button-size-small: 24px; -$panel-padding: 16px; +$panel-padding: $grid-unit-20; // @todo: retire this one. $header-height: 60px; $panel-header-height: 50px; $admin-bar-height: 32px; diff --git a/packages/components/src/panel/style.scss b/packages/components/src/panel/style.scss index ed1d293600f81..cef162f8d70cc 100644 --- a/packages/components/src/panel/style.scss +++ b/packages/components/src/panel/style.scss @@ -34,8 +34,8 @@ display: flex; justify-content: space-between; align-items: center; - padding: 0 $panel-padding; - height: 50px; + padding: 0 $grid-unit-20; + height: $grid-unit-60; border-top: $border-width solid $light-gray-500; border-bottom: $border-width solid $light-gray-500; @@ -76,12 +76,12 @@ .components-panel__body-toggle.components-button { position: relative; - padding: 15px; + padding: $grid-unit-20; outline: none; width: 100%; font-weight: 600; text-align: left; - color: $dark-gray-900; + color: $dark-gray-primary; border: none; box-shadow: none; transition: 0.1s background ease-in-out; diff --git a/packages/edit-post/src/components/sidebar/last-revision/style.scss b/packages/edit-post/src/components/sidebar/last-revision/style.scss index 54c14ec4fdc06..1b2e4357071bb 100644 --- a/packages/edit-post/src/components/sidebar/last-revision/style.scss +++ b/packages/edit-post/src/components/sidebar/last-revision/style.scss @@ -1,8 +1,9 @@ // Needs specificity, because this panel is just a button .components-panel__body.is-opened.edit-post-last-revision__panel { padding: 0; + height: $grid-unit-60; } .editor-post-last-revision__title.components-button { - padding: #{ $panel-padding - 3px } $panel-padding; // subtract extra height of dashicon + padding: $panel-padding; } diff --git a/packages/edit-post/src/components/sidebar/settings-header/style.scss b/packages/edit-post/src/components/sidebar/settings-header/style.scss index cb23ee73d5f7d..22efe4ccc68b4 100644 --- a/packages/edit-post/src/components/sidebar/settings-header/style.scss +++ b/packages/edit-post/src/components/sidebar/settings-header/style.scss @@ -1,20 +1,6 @@ -.components-panel__header.edit-post-sidebar__panel-tabs { - justify-content: flex-start; - padding-left: 0; - padding-right: $grid-unit-05; - border-top: 0; - - ul { - display: flex; - } - li { - margin: 0; - } -} - .components-button.edit-post-sidebar__panel-tab { border-radius: 0; - height: 50px - $border-width; + height: $grid-unit-60; background: transparent; border: none; box-shadow: none; @@ -23,7 +9,7 @@ padding: 3px 15px; // Use padding to offset the is-active border, this benefits Windows High Contrast mode margin-left: 0; font-weight: 400; - color: $dark-gray-900; + color: $dark-gray-primary; // This pseudo-element "duplicates" the tab label and sets the text to bold. // This ensures that the tab doesn't change width when selected. diff --git a/packages/edit-post/src/components/sidebar/style.scss b/packages/edit-post/src/components/sidebar/style.scss index d3be8c5f30caa..7b10eaec0d224 100644 --- a/packages/edit-post/src/components/sidebar/style.scss +++ b/packages/edit-post/src/components/sidebar/style.scss @@ -1,13 +1,23 @@ .components-panel__header.edit-post-sidebar__panel-tabs { justify-content: flex-start; padding-left: 0; - padding-right: $grid-unit-05; + padding-right: $grid-unit-20; border-top: 0; margin-top: 0; + ul { + display: flex; + } + li { + margin: 0; + } + .components-button.has-icon { display: none; - margin-left: auto; + margin: 0 0 0 auto; + padding: 0; + min-width: $icon-size; + height: $icon-size; @include break-medium() { display: flex; diff --git a/packages/editor/src/components/post-last-revision/style.scss b/packages/editor/src/components/post-last-revision/style.scss index 544183840e91b..6d44e617e230b 100644 --- a/packages/editor/src/components/post-last-revision/style.scss +++ b/packages/editor/src/components/post-last-revision/style.scss @@ -8,7 +8,7 @@ } .components-button.editor-post-last-revision__title { - height: auto; + height: 100%; &:hover, &:active { diff --git a/packages/editor/src/components/post-publish-panel/index.js b/packages/editor/src/components/post-publish-panel/index.js index 232d23f5cc0a9..ade6a3a552ecc 100644 --- a/packages/editor/src/components/post-publish-panel/index.js +++ b/packages/editor/src/components/post-publish-panel/index.js @@ -17,7 +17,7 @@ import { } from '@wordpress/components'; import { withSelect, withDispatch } from '@wordpress/data'; import { compose } from '@wordpress/compose'; -import { close } from '@wordpress/icons'; +import { closeSmall } from '@wordpress/icons'; /** * Internal dependencies @@ -96,7 +96,7 @@ export class PostPublishPanel extends Component { ) } "`; +exports[`Basic rendering should render 1`] = `""`; diff --git a/packages/block-editor/src/components/responsive-block-control/test/__snapshots__/index.js.snap b/packages/block-editor/src/components/responsive-block-control/test/__snapshots__/index.js.snap index a5e0beb316a34..dd8516642921c 100644 --- a/packages/block-editor/src/components/responsive-block-control/test/__snapshots__/index.js.snap +++ b/packages/block-editor/src/components/responsive-block-control/test/__snapshots__/index.js.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Basic rendering should render with required props 1`] = `"
Padding

Toggle between using the same value for all screen sizes or using a unique value per screen size.

All is used here for testing purposes to ensure we have access to details about the device.

"`; +exports[`Basic rendering should render with required props 1`] = `"
Padding

Toggle between using the same value for all screen sizes or using a unique value per screen size.

All is used here for testing purposes to ensure we have access to details about the device.

"`; diff --git a/packages/editor/src/components/post-publish-panel/test/__snapshots__/index.js.snap b/packages/editor/src/components/post-publish-panel/test/__snapshots__/index.js.snap index e31518a8c6354..350bd7040160a 100644 --- a/packages/editor/src/components/post-publish-panel/test/__snapshots__/index.js.snap +++ b/packages/editor/src/components/post-publish-panel/test/__snapshots__/index.js.snap @@ -19,7 +19,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu xmlns="http://www.w3.org/2000/svg" > } @@ -62,7 +62,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc xmlns="http://www.w3.org/2000/svg" > } @@ -108,7 +108,7 @@ exports[`PostPublishPanel should render the pre-publish panel if post status is xmlns="http://www.w3.org/2000/svg" > } @@ -152,7 +152,7 @@ exports[`PostPublishPanel should render the pre-publish panel if the post is not xmlns="http://www.w3.org/2000/svg" > } @@ -196,7 +196,7 @@ exports[`PostPublishPanel should render the spinner if the post is being saved 1 xmlns="http://www.w3.org/2000/svg" > } From 2bc99a76a87cdf1073f6ae35d6cc8d9c12e58baf Mon Sep 17 00:00:00 2001 From: jasmussen Date: Mon, 22 Jun 2020 09:25:04 +0200 Subject: [PATCH 13/13] Update snapshot. --- .../editor/plugins/__snapshots__/plugins-api.test.js.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/e2e-tests/specs/editor/plugins/__snapshots__/plugins-api.test.js.snap b/packages/e2e-tests/specs/editor/plugins/__snapshots__/plugins-api.test.js.snap index db9d191056a3e..106d6ff671948 100644 --- a/packages/e2e-tests/specs/editor/plugins/__snapshots__/plugins-api.test.js.snap +++ b/packages/e2e-tests/specs/editor/plugins/__snapshots__/plugins-api.test.js.snap @@ -2,6 +2,6 @@ exports[`Using Plugins API Document Setting Custom Panel Should render a custom panel inside Document Setting sidebar 1`] = `"My Custom Panel"`; -exports[`Using Plugins API Sidebar Medium screen Should open plugins sidebar using More Menu item and render content 1`] = `"
(no title)
Sidebar title plugin
"`; +exports[`Using Plugins API Sidebar Medium screen Should open plugins sidebar using More Menu item and render content 1`] = `"
(no title)
Sidebar title plugin
"`; -exports[`Using Plugins API Sidebar Should open plugins sidebar using More Menu item and render content 1`] = `"
(no title)
Sidebar title plugin
"`; +exports[`Using Plugins API Sidebar Should open plugins sidebar using More Menu item and render content 1`] = `"
(no title)
Sidebar title plugin
"`;