Use focus-visible for some focus styles to fix a11y issues (#12968)

feat(a11y): fix-focus-styles
This commit is contained in:
Emmanuel Pelletier
2023-03-06 11:39:46 +01:00
committed by GitHub
parent 65730e256e
commit cfb8589bef
8 changed files with 6 additions and 21 deletions

View File

@@ -69,7 +69,7 @@ const useStyles = makeStyles()(theme => {
backgroundColor: theme.palette.action01Active
},
'&:focus': {
'&.focus-visible': {
outline: 0,
boxShadow: `0px 0px 0px 2px ${theme.palette.focus01}`
},

View File

@@ -25,7 +25,7 @@ const useStyles = makeStyles()(theme => {
backgroundColor: theme.palette.ui02
},
'&:focus': {
'&.focus-visible': {
outline: 0,
boxShadow: `0px 0px 0px 2px ${theme.palette.focus01}`
},

View File

@@ -110,7 +110,7 @@ const useStyles = makeStyles()(theme => {
backgroundColor: theme.palette.ui03
},
'&:focus': {
'&.focus-visible': {
boxShadow: `inset 0 0 0 2px ${theme.palette.action01Hover}`
}
},

View File

@@ -23,12 +23,6 @@ const useStyles = makeStyles()(theme => {
justifyContent: 'space-between'
},
closeIcon: {
'&:focus': {
boxShadow: 'none'
}
},
title: {
color: theme.palette.text01,
...withPixelLineHeight(theme.typography.heading5),
@@ -138,7 +132,6 @@ const Dialog = ({
{!hideCloseButton && (
<ClickableIcon
accessibilityLabel = { t('dialog.close') }
className = { classes.closeIcon }
icon = { IconCloseLarge }
id = 'modal-header-close-button'
onClick = { onClose } />

View File

@@ -112,12 +112,6 @@ const useStyles = makeStyles()(theme => {
}
},
closeIcon: {
'&:focus': {
boxShadow: 'none'
}
},
content: {
flexGrow: 1,
overflowY: 'auto',
@@ -259,7 +253,6 @@ const DialogWithTabs = ({
const closeIcon = useMemo(() => (
<ClickableIcon
accessibilityLabel = { t('dialog.close') }
className = { classes.closeIcon }
icon = { IconCloseLarge }
id = 'modal-header-close-button'
onClick = { onClose } />
@@ -299,7 +292,6 @@ const DialogWithTabs = ({
<span className = { classes.backContainer }>
<ClickableIcon
accessibilityLabel = { t('dialog.Back') }
className = { classes.closeIcon }
icon = { IconArrowBack }
id = 'modal-header-back-button'
onClick = { back } />

View File

@@ -44,7 +44,7 @@ const useStyles = makeStyles()(theme => {
borderColor: theme.palette.ui10
},
'&:focus': {
'&.focus-visible': {
outline: 0,
boxShadow: `0px 0px 0px 2px ${theme.palette.focus01}`,
border: 0,