From c98e36912ec2eb43a4629c9d1f69dab5a064a3b1 Mon Sep 17 00:00:00 2001 From: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Date: Wed, 29 Nov 2023 18:25:11 +1000 Subject: [PATCH] Buttons: Clean up editor styles and fix button text transform --- packages/block-library/src/button/editor.scss | 39 ------------------- packages/block-library/src/button/style.scss | 4 ++ .../block-library/src/buttons/editor.scss | 6 --- 3 files changed, 4 insertions(+), 45 deletions(-) diff --git a/packages/block-library/src/button/editor.scss b/packages/block-library/src/button/editor.scss index 3c36586bbfabdf..0ba758c344eb9d 100644 --- a/packages/block-library/src/button/editor.scss +++ b/packages/block-library/src/button/editor.scss @@ -76,42 +76,3 @@ div[data-type="core/button"] { display: table; } -.editor-styles-wrapper .wp-block-button[style*="text-decoration"] .wp-block-button__link { - text-decoration: inherit; -} - -.editor-styles-wrapper .wp-block-button .wp-block-button__link { - // The following styles ensure a default border is applied when the user selects only a border color or style in the editor, - // but no width. They override the `border-width: 0;` applied by core's theme.json via the Elements API button. - &:where(.has-border-color) { - border-width: initial; - } - &:where([style*="border-top-color"]) { - border-top-width: initial; - } - &:where([style*="border-right-color"]) { - border-right-width: initial; - } - &:where([style*="border-bottom-color"]) { - border-bottom-width: initial; - } - &:where([style*="border-left-color"]) { - border-left-width: initial; - } - - &:where([style*="border-style"]) { - border-width: initial; - } - &:where([style*="border-top-style"]) { - border-top-width: initial; - } - &:where([style*="border-right-style"]) { - border-right-width: initial; - } - &:where([style*="border-bottom-style"]) { - border-bottom-width: initial; - } - &:where([style*="border-left-style"]) { - border-left-width: initial; - } -} diff --git a/packages/block-library/src/button/style.scss b/packages/block-library/src/button/style.scss index d9efc928c5b1c7..0e507526a88775 100644 --- a/packages/block-library/src/button/style.scss +++ b/packages/block-library/src/button/style.scss @@ -34,6 +34,10 @@ $blocks-block__margin: 0.5em; padding: calc(0.667em + 2px) calc(1.333em + 2px); } +.wp-block-button[style*="text-transform"] .wp-block-button__link { + text-transform: inherit; +} + .wp-block-button[style*="text-decoration"] .wp-block-button__link { text-decoration: inherit; } diff --git a/packages/block-library/src/buttons/editor.scss b/packages/block-library/src/buttons/editor.scss index 018ca3b7e2f8e8..1f964c32fa9407 100644 --- a/packages/block-library/src/buttons/editor.scss +++ b/packages/block-library/src/buttons/editor.scss @@ -54,12 +54,6 @@ $blocks-block__margin: 0.5em; margin-bottom: 0; } } - - .editor-styles-wrapper &.has-custom-font-size { - .wp-block-button__link { - font-size: inherit; - } - } } .wp-block[data-align="center"] > .wp-block-buttons {