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
aa3e72ec6d
commit
d71fbf8c06
1 file changed
+9
-2
@@ -7,6 +7,13 @@ import { alpha } from "@mui/material/styles";
|
||||
|
||||
export const ToggleButtonInput = ({ sx, ...props }: ToggleButtonProps) => {
|
||||
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 (
|
||||
<ToggleButton
|
||||
{...props}
|
||||
@@ -25,11 +32,11 @@ export const ToggleButtonInput = ({ sx, ...props }: ToggleButtonProps) => {
|
||||
backgroundColor: theme.palette.action.hover,
|
||||
},
|
||||
"&.Mui-selected": {
|
||||
backgroundColor: alpha(theme.palette.primary.main, 0.06),
|
||||
backgroundColor: selectedBg,
|
||||
color: theme.palette.text.primary,
|
||||
fontWeight: 500,
|
||||
"&:hover": {
|
||||
backgroundColor: alpha(theme.palette.primary.main, 0.1),
|
||||
backgroundColor: selectedHoverBg,
|
||||
},
|
||||
},
|
||||
...sx,
|
||||
|
||||
Reference in new issue
Block a user