fix(component): adjust autofill style (#4773)

This commit is contained in:
JimmFly
2023-10-31 23:30:35 +08:00
committed by GitHub
parent db36f81d24
commit 97d189f1c8

View File

@@ -74,6 +74,14 @@ export const input = style({
'&::placeholder': { '&::placeholder': {
color: 'var(--affine-placeholder-color)', color: 'var(--affine-placeholder-color)',
}, },
'&:autofill, &:-webkit-autofill, &:-internal-autofill-selected, &:-webkit-autofill:hover, &:-webkit-autofill:focus, &:-webkit-autofill:active':
{
// The reason for using !important here is:
// The user agent style sheets of many browsers utilise !important in their :-webkit-autofill style declarations.
// https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill#:~:text=%2C%20254)-,!important,-%3B%0Abackground%2Dimage
backgroundColor: 'var(--affine-white-10) !important',
['-webkit-box-shadow' as string]: 'none !important',
},
'&:disabled': { '&:disabled': {
color: 'var(--affine-text-disable-color)', color: 'var(--affine-text-disable-color)',
}, },