Skip to content

Commit

Permalink
refactor: code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
saiponnada committed Sep 18, 2024
1 parent 133d1d2 commit 12f9923
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
5 changes: 2 additions & 3 deletions dist/button/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ button.btn--fixed-height,
button.btn--truncated {
height: 40px;
}
a.fake-btn:focus,
button.btn:focus {
a.fake-btn:focus-visible,
button.btn:focus-visible {
outline-offset: var(--spacing-25);
outline-style: solid;
outline-width: var(--spacing-25);
}
a.fake-btn:focus:not(:focus-visible),
button.btn:focus:not(:focus-visible) {
outline: none;
outline-offset: 0;
}

button.btn[aria-disabled="true"],
Expand Down
3 changes: 1 addition & 2 deletions dist/cta-button/cta-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ a.cta-btn--fixed-height,
a.cta-btn--truncated {
height: 40px;
}
a.cta-btn:focus {
a.cta-btn:focus-visible {
outline-offset: var(--spacing-25);
outline-style: solid;
outline-width: var(--spacing-25);
}
a.cta-btn:focus:not(:focus-visible) {
outline: none;
outline-offset: 0;
}

a.cta-btn:visited {
Expand Down
4 changes: 1 addition & 3 deletions src/sass/mixins/private/_button-mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ $button-border-radius-large: 24px;
height: 40px;
}

/* TODO: use :focus-visble once we support safari 15+ */
&:focus {
&:focus-visible {
outline-offset: var(--spacing-25);
outline-style: solid;
outline-width: var(--spacing-25);
Expand All @@ -38,7 +37,6 @@ $button-border-radius-large: 24px;
/* https://developer.paciellogroup.com/blog/2018/03/focus-visible-and-backwards-compatibility/ */
&:focus:not(:focus-visible) {
outline: none;
outline-offset: 0;
}
}

Expand Down

0 comments on commit 12f9923

Please sign in to comment.