fix(client): bump dark-mode selected toggle background so it stands out
The 6% primary tint that read fine in light mode disappeared against dark backgrounds. Use a 22% tint in dark mode (30% on hover) and keep the lighter 6/10% in light mode.
This commit is contained in:
1 parent
79f8947742
commit
32fbe8b8c3
1 file changed
+9
-2
@@ -7,6 +7,13 @@ import { alpha } from "@mui/material/styles";
|
|||||||
|
|
||||||
export const ToggleButtonInput = ({ sx, ...props }: ToggleButtonProps) => {
|
export const ToggleButtonInput = ({ sx, ...props }: ToggleButtonProps) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
const isDark = theme.palette.mode === "dark";
|
||||||
|
const selectedBg = isDark
|
||||||
|
? alpha(theme.palette.primary.main, 0.22)
|
||||||
|
: alpha(theme.palette.primary.main, 0.06);
|
||||||
|
const selectedHoverBg = isDark
|
||||||
|
? alpha(theme.palette.primary.main, 0.3)
|
||||||
|
: alpha(theme.palette.primary.main, 0.1);
|
||||||
return (
|
return (
|
||||||
<ToggleButton
|
<ToggleButton
|
||||||
{...props}
|
{...props}
|
||||||
@@ -25,11 +32,11 @@ export const ToggleButtonInput = ({ sx, ...props }: ToggleButtonProps) => {
|
|||||||
backgroundColor: theme.palette.action.hover,
|
backgroundColor: theme.palette.action.hover,
|
||||||
},
|
},
|
||||||
"&.Mui-selected": {
|
"&.Mui-selected": {
|
||||||
backgroundColor: alpha(theme.palette.primary.main, 0.06),
|
backgroundColor: selectedBg,
|
||||||
color: theme.palette.text.primary,
|
color: theme.palette.text.primary,
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
"&:hover": {
|
"&:hover": {
|
||||||
backgroundColor: alpha(theme.palette.primary.main, 0.1),
|
backgroundColor: selectedHoverBg,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
...sx,
|
...sx,
|
||||||
|
|||||||
Reference in new issue
Block a user