-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[TextField] Fix media hover specificity issue #16266
Conversation
-Desc: highlight TextField varient outlines border color on focus event on mobile
Details of bundle changes.Comparing: c0e4103...4965b02
|
-Desc: highlight TextField varient outlines border color on focus event on mobile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on mobile, works for me
The current approach outputs the following CSS: .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline { /* Specificity = 3 */
border-color: rgba(0, 0, 0, 0.87);
}
.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline { /* Specificity = 3 */
border-color: #2196f3;
border-width: 2px;
}
@media (hover: none) {
.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline:hover .MuiOutlinedInput-notchedOutline { /* Specificity = 5 */
border-color: rgba(0, 0, 0, 0.23);
}
} I have updated the pull request to use the patch proposed in the GitHub issue. It outputs the following CSS: .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline { /* Specificity = 3 */
border-color: rgba(0, 0, 0, 0.87);
}
@media (hover: none) {
.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline { /* Specificity = 3 */
border-color: rgba(0, 0, 0, 0.23);
}
}
.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline { /* Specificity = 3 */
border-color: #2196f3;
border-width: 2px;
} Notice how the specificity is minimized and the style rule order is correct. |
@arminydy It's a great first pull request on Material-UI 👌🏻. Thank you for working on it! |
Closes #16149
Highlight TextField varient outlines border color on focus event on mobile