-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add focused stylign to tabs #714
Conversation
@@ -94,6 +94,11 @@ export const StyledTab = styled(RawTab, { | |||
color: black; | |||
} | |||
&.Mui-focusVisible { | |||
outline: 5px auto Highlight; | |||
outline: 5px auto -webkit-focus-ring-color; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently the same focus outline that buttons have:
I am not a designer, and I'm happy to change this to something else. Figured it made sense for now to keep it simple and match buttons and text inputs.
Note that mui has default focus styles which we're suppressing as part of the theme:
sci-components/packages/components/src/core/styles/common/defaultTheme.ts
Lines 283 to 298 in 9451847
MuiButtonBase: { | |
defaultProps: { | |
disableRipple: true, | |
}, | |
}, | |
MuiLink: { | |
defaultProps: { | |
underline: "hover", | |
}, | |
}, | |
MuiTab: { | |
defaultProps: { | |
disableRipple: true, | |
}, | |
}, | |
}, |
We could turn those back on, although it looks weird and would take tweaking colors for both buttons and tabs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 hmm... Are we re-doing work that we can just get for free from Mui?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We definitely are, although I think it would take design and eng work to get back to something that looks reasonable with the defaults for all components.
Thanks 🙏 |
This PR adds a focus outline to the tabs component, for the SDS accessibility hackday project.
See it live on Chromatic
Keyboard usage of the tabs is actually working as expected: