fix(ui): override browser autofill text color in dark mode#29807
Conversation
Browser autofill injects -webkit-text-fill-color and a tinted background that bypasses CSS custom properties, causing black text on dark backgrounds. Add autofill overrides in @layer base using --cal-text and --cal-bg tokens so both light and dark themes render autofilled fields correctly.
|
Welcome to Cal.diy, @okxint! Thanks for opening this pull request. A few things to keep in mind:
A maintainer will review your PR soon. Thanks for contributing! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdded global base CSS rules for WebKit autofilled inputs. The rules apply themed text and background colors across autofill interaction states and add a background-color transition. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
Fixes #29803
Browser autofill injects
-webkit-text-fill-colorand a solid background color that completely bypass CSS custom properties. In dark mode this renders autofilled inputs with black text on a dark background — unreadable.Fix: add autofill overrides in
@layer baseinapps/web/styles/globals.css:The
--cal-textand--cal-bgtokens are already defined inpackages/config/theme/tokens.csswith correct light/dark values. Thebox-shadowinset trick overrides the browser's autofill background without usingbackground-color, which is ignored by autofill UA styles.