Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buttons: Clean up editor styles and fix button text transform #56630

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 0 additions & 39 deletions packages/block-library/src/button/editor.scss
Expand Up @@ -33,42 +33,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;
}
}
4 changes: 4 additions & 0 deletions packages/block-library/src/button/style.scss
Expand Up @@ -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;
}
Expand Down
6 changes: 0 additions & 6 deletions packages/block-library/src/buttons/editor.scss
Expand Up @@ -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 {
Expand Down