Skip to content

Conversation

@ludij
Copy link

@ludij ludij commented Dec 13, 2025

Fixes #44665

@mui-bot
Copy link

mui-bot commented Dec 13, 2025

Netlify deploy preview

https://deploy-preview-47472--material-ui.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/material 🔺+396B(+0.08%) 🔺+95B(+0.06%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 073a378

@ludij ludij changed the title [theme] Add var for webkit autofill color [theme] Add var for webkit autofill color on input components Dec 13, 2025
@ludij ludij force-pushed the feature-add-theme-var-for-webkit-autofill-color branch from 4f880ef to d5bbc66 Compare December 13, 2025 19:44
@zannager zannager added the scope: text field Changes related to the text field. label Dec 16, 2025
@zannager zannager requested a review from siriwatknp December 16, 2025 14:57
setColor(palette.FilledInput, 'bg', 'rgba(0, 0, 0, 0.06)');
setColor(palette.FilledInput, 'hoverBg', 'rgba(0, 0, 0, 0.09)');
setColor(palette.FilledInput, 'disabledBg', 'rgba(0, 0, 0, 0.12)');
setColor(palette.FilledInput, 'autofillWebkitShadowBox', 'unset');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
setColor(palette.FilledInput, 'autofillWebkitShadowBox', 'unset');
setColor(palette.Input, 'autofillWebkitShadowBox', 'unset');

I think it makes more sense to share the token between FillInput and OutlinedInput.
An app likely has consistent autofill styles.

borderTopRightRadius: 'inherit',
},
}),
...(theme.vars && {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't change the logic for non theme.vars.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the logic back to what it was. I understand I should keep changes to a minimum.

I chose to rewrite the logic to align with how it's done earlier in the file (starting at line 60). If I'm not mistaken that approach (for FilledInputRoot) generates only as much CSS as needed for the current theme. The current logic (for FilledInputInput) generates CSS for both light and dark themes even when only one of them can be in use.

},
[theme.getColorSchemeSelector('dark')]: {
'&:-webkit-autofill': {
WebkitBoxShadow: '0 0 0 100px #266798 inset',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change should be minimal here with a new token used and for light mode.

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comments

@ludij ludij force-pushed the feature-add-theme-var-for-webkit-autofill-color branch from d364e9d to 413af77 Compare December 21, 2025 21:45
@ludij ludij requested a review from siriwatknp December 21, 2025 22:05
@ludij
Copy link
Author

ludij commented Dec 21, 2025

@siriwatknp Could you please re-trigger the test-dev builds? Seems like a resource issue that caused the failure, not an issue with my changes :)

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

Labels

scope: text field Changes related to the text field.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TextField] Default Webkit autofill color does not use variables or palette

4 participants