Skip to content

Commit

Permalink
Button Block: Change text-decoration style to low specificity
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Jul 20, 2022
1 parent 49a4a01 commit d7fe6f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/block-library/src/button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ $blocks-block__margin: 0.5em;
cursor: pointer;
display: inline-block;
text-align: center;
text-decoration: none;
word-break: break-word; // overflow-wrap doesn't work well if a link is wrapped in the div, so use word-break here.
box-sizing: border-box;

Expand All @@ -32,6 +31,9 @@ $blocks-block__margin: 0.5em;
// These rules are set to zero specificity to keep the default styles for buttons.
// They are needed for backwards compatibility.
:where(.wp-block-button__link) {
// This needs a low specificity so it won't override the rules from the button element if defined in theme.json.
text-decoration: none;

// 100% causes an oval, but any explicit but really high value retains the pill shape.
border-radius: 9999px;

Expand Down

0 comments on commit d7fe6f7

Please sign in to comment.