-
-
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
[Lab] ToggleButton Style backgroundColor override when selected={true} #22275
Comments
👋 Thanks for using Material-UI! We use GitHub issues exclusively as a bug and feature requests tracker, however, For support, please check out https://material-ui.com/getting-started/support/. Thanks! If you have a question on StackOverflow, you are welcome to link to it here, it might help others. |
Sorry, to raise a dumb issue |
@TRCloud How did you solve this issue? Edit: Solved by adding the empty |
@mbrookes Looks like the exact same question you asked me yesterday. I'm glad v5 API, by design, solve this issue. |
@oliviertassinari May I ask how v5 API will solve it? |
By forcing to increase the specificity. |
See also: #23755 – we may add a prop for this. |
We tried to override the background color when ToggleButton is selected.
We found that no matter how we try, the background color would be controlled by
.MuiToggleButton-root.Mui-selected:hover
We are sure that we targeted the right
selected
Pseudo-class successfully by adding a border around each button when selected.Our ToggleButton looks like this:
Our makeStyle:
And in Chrome Dev we found the following styles generated by our code
being overrided by the following:
Summary 💡
We would like to be able to easily override the background color of ToggleButton when it is
selected
.Motivation 🔦
Make it a more easier to use element of Material UI
The text was updated successfully, but these errors were encountered: