Skip to content

Commit 094d76a

Browse files
authored
Merge pull request #13699 from micahgodbolt/13373-highcontrast-focus
UI: Fix shortcut button focus border to support high contrast
2 parents 570ff50 + 7e32605 commit 094d76a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/ui/src/components/sidebar/Menu.tsx

+13-1
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,21 @@ export const MenuButton = styled(Button)<MenuButtonProps>(({ highlighted, theme
4545
position: 'relative',
4646
overflow: 'visible',
4747
padding: 7,
48+
transition: 'none', // prevents button border from flashing when focused/blurred
4849
'&:focus': {
4950
background: theme.barBg,
50-
boxShadow: `${theme.color.secondary} 0 0 0 1px inset`,
51+
boxShadow: 'none',
52+
},
53+
// creates a pseudo border that does not affect the box model, but is accessible in high contrast mode
54+
'&:focus:before': {
55+
content: '""',
56+
position: 'absolute',
57+
top: 0,
58+
bottom: 0,
59+
left: 0,
60+
right: 0,
61+
borderRadius: '100%',
62+
border: `1px solid ${theme.color.secondary}`,
5163
},
5264

5365
...(highlighted && {

0 commit comments

Comments
 (0)