Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

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

JimmFly97d189f1c8f9
diff --git a/packages/frontend/component/src/ui/input/style.css.ts b/packages/frontend/component/src/ui/input/style.css.ts
index e5613ccb76..1a28265a05 100644
--- a/packages/frontend/component/src/ui/input/style.css.ts
+++ b/packages/frontend/component/src/ui/input/style.css.ts
@@ -74,6 +74,14 @@ export const input = style({
'&::placeholder': {
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': {
color: 'var(--affine-text-disable-color)',
},