Skip to content

Commit 2ca0298

Browse files
committed
fix: add focus styling to checkboxes
1 parent 61fac2d commit 2ca0298

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

site/src/theme/theme.ts

+20
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,26 @@ dark = createTheme(dark, {
427427
MuiCheckbox: {
428428
styleOverrides: {
429429
root: {
430+
/**
431+
* Adds focus styling to checkboxes (which doesn't exist normally, for
432+
* some reason?).
433+
*
434+
* The checkbox component is a root span with a checkbox input inside
435+
* it. MUI does not allow you to use selectors like (& input) to
436+
* target the inner checkbox (even though you can use & td to style
437+
* tables). Tried every combination of selector possible (including
438+
* lots of !important), and the main issue seems to be that the
439+
* styling just never gets processed for it to get injected into the
440+
* CSSOM.
441+
*
442+
* Had to settle for adding styling to the span itself (which does
443+
* make the styling more obvious, even if there's not much room for
444+
* customization).
445+
*/
446+
"&.Mui-focusVisible": {
447+
outline: `10px auto ${colors.blue[7]}`,
448+
},
449+
430450
"&.Mui-disabled": {
431451
color: colors.gray[11],
432452
},

0 commit comments

Comments
 (0)