fix(client): dark-mode text-field polish
- MuiOutlinedInput hover override: was inheriting MUI's default white outline in dark mode (too bright). Now uses an alpha-23% white in dark and text.primary in light. - TextInput: -webkit-autofill now repaints the input bg with background.paper (instead of Chrome's harsh blue/yellow autofill highlight), text in text.primary, with the standard 5000s-transition trick to suppress the brief flash. Works in both modes.
This commit is contained in:
1 parent
0c765d5ce5
commit
6a6c16dbb2
2 files changed
+16
-2
No files matched your search
@@ -38,6 +38,14 @@ export const TextInput = forwardRef<HTMLInputElement, TextInputProps>(function T
|
||||
marginRight: 0,
|
||||
marginTop: theme.spacing(1),
|
||||
},
|
||||
"& input:-webkit-autofill, & input:-webkit-autofill:hover, & input:-webkit-autofill:focus, & input:-webkit-autofill:active":
|
||||
{
|
||||
WebkitBoxShadow: `0 0 0 100px ${theme.palette.background.paper} inset`,
|
||||
WebkitTextFillColor: theme.palette.text.primary,
|
||||
caretColor: theme.palette.text.primary,
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
transition: "background-color 5000s ease-in-out 0s",
|
||||
},
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -120,11 +120,17 @@ export const theme = (mode: string, palette: any) =>
|
||||
|
||||
MuiOutlinedInput: {
|
||||
styleOverrides: {
|
||||
root: {
|
||||
root: ({ theme }) => ({
|
||||
"&:hover .MuiOutlinedInput-notchedOutline": {
|
||||
borderColor:
|
||||
theme.palette.mode === "dark"
|
||||
? "rgba(255, 255, 255, 0.23)"
|
||||
: theme.palette.text.primary,
|
||||
},
|
||||
"&.Mui-focused .MuiOutlinedInput-notchedOutline": {
|
||||
borderColor: palette.primary.main,
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user