Skip to content

Commit

Permalink
Apply smaller focus ring to plain and monochrome buttons (#11473)
Browse files Browse the repository at this point in the history
Closes #11422

Reduces the focus ring closer to the original size for the `plain` and
`plainMonochrome` button variants. This PR also applied the underline
text decoration styles when focused for the `plain` varaint.

### `plain`


https://github.com/Shopify/polaris/assets/11774595/a46629d5-d0e5-414d-8296-7caba60d0831

### `plainMonochrome`


https://github.com/Shopify/polaris/assets/11774595/785757b2-7b9b-4f15-b3b0-53b0b2ce8285
  • Loading branch information
sam-b-rose authored Jan 21, 2024
1 parent c9abd3c commit 6579537
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-dancers-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Fixed focus ring size for plain and plain monochrome Button variants
9 changes: 7 additions & 2 deletions polaris-react/src/components/Button/Button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@
--pc-button-color_active: var(--p-color-text-link-active);
}

.variantPlain:hover,
.variantPlain:active {
.variantPlain:is(:hover, :active, :focus-visible) {
text-decoration: underline;
}

Expand All @@ -194,6 +193,12 @@
line-height: var(--p-font-line-height-400);
}

.variantPlain:focus-visible,
.variantMonochromePlain:focus-visible {
border-radius: var(--p-border-radius-300);
outline-offset: calc(-1 * var(--pc-button-padding-block));
}

// TONES
.toneSuccess:is(.variantSecondary, .variantTertiary, .variantPlain) {
--pc-button-color: var(--p-color-text-success);
Expand Down

0 comments on commit 6579537

Please sign in to comment.