Skip to content

fix: add missing focus state styling to buttons and checkboxes #10614

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

Merged
merged 4 commits into from
Nov 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: swap outlines for box-shadows for more styling control
  • Loading branch information
Parkreiner committed Nov 9, 2023
commit 97c2bbd08b4b6e5b10c2168dc72a1c6e2f937692
8 changes: 5 additions & 3 deletions site/src/theme/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ dark = createTheme(dark, {
* customization).
*/
"&.Mui-focusVisible": {
Copy link
Member Author

@Parkreiner Parkreiner Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long comment, but trying all these selectors and seeing what exactly was happening is the reason this PR took so long. Wanted to try preventing other people from going down this rabbit hole

outline: `10px auto ${colors.blue[7]}`,
boxShadow: `0 0 0 2px ${colors.blue[7]}`,
},

"&.Mui-disabled": {
Expand All @@ -458,7 +458,9 @@ dark = createTheme(dark, {
styleOverrides: {
root: {
".Mui-focusVisible .MuiSwitch-thumb": {
outline: `10px auto ${colors.blue[7]}`,
// Had to thicken outline to make sure that the focus color didn't
// bleed into the thumb and was still easily-visible
boxShadow: `0 0 0 3px ${colors.blue[7]}`,
},
},
},
Expand Down Expand Up @@ -526,7 +528,7 @@ dark = createTheme(dark, {
styleOverrides: {
root: {
"&.Mui-focusVisible": {
outline: `10px auto ${colors.blue[7]}`,
boxShadow: `0 0 0 2px ${colors.blue[7]}`,
},
},
},
Expand Down