Use focus-visible for some focus styles to fix a11y issues (#12968)
feat(a11y): fix-focus-styles
This commit is contained in:
parent
65730e256e
commit
cfb8589bef
|
@ -90,7 +90,7 @@ body.welcome-page {
|
|||
font-size: 14px;
|
||||
padding-left: 10px;
|
||||
|
||||
&:focus {
|
||||
&.focus-visible {
|
||||
outline: auto 2px #005fcc;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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}`
|
||||
},
|
||||
|
|
|
@ -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}`
|
||||
},
|
||||
|
|
|
@ -110,7 +110,7 @@ const useStyles = makeStyles()(theme => {
|
|||
backgroundColor: theme.palette.ui03
|
||||
},
|
||||
|
||||
'&:focus': {
|
||||
'&.focus-visible': {
|
||||
boxShadow: `inset 0 0 0 2px ${theme.palette.action01Hover}`
|
||||
}
|
||||
},
|
||||
|
|
|
@ -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 } />
|
||||
|
|
|
@ -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 } />
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -94,7 +94,7 @@ const useStyles = makeStyles()(theme => {
|
|||
top: 0,
|
||||
width: '100%',
|
||||
|
||||
'&:focus': {
|
||||
'&.focus-visible': {
|
||||
// override global styles in order to use our own color
|
||||
outline: 'none !important',
|
||||
|
||||
|
|
Loading…
Reference in New Issue