Skip to content

fix(theme): align input autofill with obsidian surfaces#117

Merged
mkayander merged 4 commits intomainfrom
cursor/input-dark-background-9649
Apr 6, 2026
Merged

fix(theme): align input autofill with obsidian surfaces#117
mkayander merged 4 commits intomainfrom
cursor/input-dark-background-9649

Conversation

@mkayander
Copy link
Copy Markdown
Owner

@mkayander mkayander commented Apr 6, 2026

Summary

Text fields showed an odd dark blue wash from MUI’s default :-webkit-autofill handling (#266798 inset) and/or filled input backgrounds.

Changes

  • MuiOutlinedInput: root backgroundColor is transparent so outlined fields show the parent surface; no separate input “panel” color.
  • :-webkit-autofill: use WebkitBoxShadow: 0 0 0 100px transparent inset plus textPrimary for fill/caret (no color-matching logic, works regardless of selector quirks).
  • MuiFilledInput: root background forced transparent across default, hover, focus, and disabled so filled variant also blends with the parent (if used).

Testing

  • pnpm run tsc passes.
  • eslint src/themes.ts passes.
Open in Web Open in Cursor 

MUI hardcodes #266798 for :-webkit-autofill in dark mode. Override
OutlinedInput and FilledInput input slot styles to use surface tokens
and readable text/caret colors for both css vars and legacy paths.

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dstruct Ready Ready Preview, Comment Apr 6, 2026 10:28pm

@mkayander mkayander marked this pull request as ready for review April 6, 2026 22:00
Extract shared shadow/text/caret logic and MUI vars vs legacy branching
into helpers. Narrow getColorSchemeSelector with an in-check (no cast).

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
Single-scheme dark themes get getColorSchemeSelector('dark') === '&',
which nested with &-webkit-autofill produced an invalid selector so MUI's
#266798 default still showed. Use flat &-webkit-autofill when mode is dark.

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
OutlinedInput root uses transparent so fields sit on parent surface.
Webkit autofill uses transparent 100px inset to drop MUI's blue fill.
FilledInput root states forced transparent for consistency.

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
@mkayander mkayander merged commit a072efd into main Apr 6, 2026
6 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 6, 2026
## [1.374.1](v1.374.0...v1.374.1) (2026-04-06)

### Bug Fixes

* **theme:** align input autofill with obsidian surfaces ([#117](#117)) ([a072efd](a072efd)), closes [#266798](https://github.com/mkayander/dStruct/issues/266798) [#266798](https://github.com/mkayander/dStruct/issues/266798)
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

🎉 This PR is included in version 1.374.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants