-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hardcoded Input underline color #13817
Comments
@Co0sh What about? const theme = createMuiTheme({
overrides: {
MuiInput: {
underline: {
"&:before": {
borderBottom: `1px solid ${color}`
}
}
}
}
}); |
Yes, it definitely works, but I guess my point is that this doesn't feel like a correct solution. Is there any reason to have the underline the way it is right now and not as I described? |
@Co0sh What would be the correct solution? |
Now that I think of it, it might not be a good idea after all. Changing the underline color could be a breaking change for people with custom themes, unless it's put in its own variable and not computed out of some other colors. Thanks for the help though, I'll use the override for now 👌 |
@Co0sh This is a problem we have been wrapping our head around for quite some time. Some alternatives:
|
Tinkering with the Input underline as well at the moment. I'm getting rid of the scale transformation and I would like to have just a simple color transition on |
@optimista Did these demos help? https://material-ui.com/components/text-fields/#customized-inputs |
As seen here line, the color of the underline in the Input component is set to be dark on light theme and light on dark theme. It's not configurable though, so we can't change it via custom theme, only by overriding classes. You can however change all other colors using theme alone, which seems like an inconsistency.
I'd like to submit a PR changing this to some value from theme, but I'm not sure which one - default text colors don't match this particular underline.
Expected Behavior 🤔
The color for the underline should be taken from theme.
Current Behavior 😯
The color is hardcoded.
Steps to Reproduce 🕹
Link: https://codesandbox.io/s/8xv2k57ym8
Context 🔦
I'd like to style it in some other way than overriding quite complex JSS classes every time.
Your Environment 🌎
The text was updated successfully, but these errors were encountered: