[MenuItem] background-color can't override due to specificity
See original GitHub issue- This is a v1.x issue.
- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
MenuItem
can override selected style.
Current Behavior
MenuItem
can’t override selected style due to specificity.
see: https://github.com/mui-org/material-ui/blob/7fdc1890fb744b565480835fd5684e66871c679f/packages/material-ui/src/MenuItem/MenuItem.js#L20-L22
Steps to Reproduce
Link: https://codesandbox.io/s/6v2kolp19n
Context
In my case, I override selected style with createMuiTheme
function, so no problem for me.
but it might be helpful to someone.
I’ll make a PR with removing &$selected
property and copying to selected
property as default css.
Thank you for taking time.
Your Environment
Tech | Version |
---|---|
Material-UI | v1.4.0 |
React | |
browser | |
etc. |
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
[MenuItem] background-color can't override due to specificity
In my case, I override selected style with createMuiTheme function, so no problem for me. but it might be helpful to someone. I'll...
Read more >How to override Material-UI MenuItem selected background ...
A workaround could be to apply the appropriate background color in the root css according to the selected state and to not use...
Read more >How to override Material-UI MenuItem selected background ...
[Solved]-How to override Material-UI MenuItem selected background color?- ... Mui-selected The specificity of those two classes is taking priority over the ...
Read more >issue with styling a menuBar's background color? — oracle-tech
Hello all, I have been trying to style a menuBar but it seems I'm either not doing it correctly, or it's not working....
Read more >How can I style each nav menu item to have different ...
Is there an easy way to change the background color and hover colors for EACH menu item? It seems I can only change...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Dror88 Same answer as in https://github.com/mui-org/material-ui/issues/10620
I’m happy to share the vision 😃