Skip to content

Commit

Permalink
Fix primary button focus styles
Browse files Browse the repository at this point in the history
  • Loading branch information
pksjce committed Apr 4, 2022
1 parent 60015eb commit 851a40c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 153 deletions.
6 changes: 2 additions & 4 deletions src/Button/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme
},
...fallbackFocus,
'&:focus-visible:not([disabled])': {
outline: '2px solid',
outlineOffset: '0',
outlineColor: 'accent.fg',
boxShadow: 'inset 0 0 0 2px'
...focusOutlineStyles,
boxShadow: 'inset 0 0 0 3px'
},
'&:active:not([disabled])': {
backgroundColor: 'btn.primary.selectedBg',
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/__snapshots__/Button.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -687,9 +687,9 @@ exports[`Button styles primary button appropriately 1`] = `
.c0:focus-visible:not([disabled]) {
outline: 2px solid;
outline-offset: 0;
outline-color: accent.fg;
box-shadow: inset 0 0 0 2px;
outline-offset: -2px;
box-shadow: inset 0 0 0 3px;
}
.c0:active:not([disabled]) {
Expand Down
3 changes: 0 additions & 3 deletions src/__tests__/__snapshots__/ToggleSwitch.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ exports[`renders consistently 1`] = `
width: 64px;
outline-offset: 2px;
position: relative;
background-color: #eaeef2;
border-color: #afb8c1;
}
.c4:after {
Expand Down Expand Up @@ -162,7 +160,6 @@ exports[`renders consistently 1`] = `
background-color: #f6f8fa;
border-width: 1px;
border-style: solid;
border-color: #afb8c1;
border-radius: calc(6px - 1px);
box-shadow: 0 3px 6px rgba(140,149,159,0.15),inset 0 1px 0 rgba(255,255,255,0.25);
width: 50%;
Expand Down
Loading

0 comments on commit 851a40c

Please sign in to comment.