Skip to content

Commit

Permalink
Buttons: Clean up editor styles and fix button text transform
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Nov 29, 2023
1 parent 702f340 commit c98e369
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 45 deletions.
39 changes: 0 additions & 39 deletions packages/block-library/src/button/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
4 changes: 4 additions & 0 deletions packages/block-library/src/button/style.scss
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit c98e369

Please sign in to comment.