Wrong color applied to link when overriding MUI theme
See original GitHub issueWe have a Next.js application that we are in the midst of upgrading from MUI v4 to MUI v5 with react-tss. Part of our theme file is as follows:
MuiLink: {
styleOverrides: {
root: {
color: '#0068b5',
textDecoration: 'none',
},
underlineNone: {
color: '#f9f9f6',
},
},
defaultProps: {
underline: 'hover',
},
},
In MUI v4, this color was correctly applied. However, in MUI v5 with react-tss, our link styles look like this:
It appears that instead of replacing the original color
CSS property the new color is simply being added as an additional property. And unfortunately, probably based on the order styles are applied, the wrong color is taking precedence over the desired color. Any ideas here?
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:10 (5 by maintainers)
Top Results From Across the Web
[Link] color cannot be overwritten by styleOverrides #32574
Current behavior 😯 When using MuiLink with a specific color we are unable to overwrite the color in styleOverrides. The result is that...
Read more >Material UI - Theme is overriding the wrong component
I've made two Material-UI components. Both are using themes. However, the overrides on one theme ...
Read more >How to customize - Material UI - MUI
Overriding styles with class names To override the styles of a specific part of the component, use the global classes provided by Material...
Read more >Theming - Material UI - MUI
The theme specifies the color of the components, darkness of the surfaces, level of shadow, appropriate opacity of ink elements, etc.
Read more >Palette - Material UI - MUI
The theme exposes the following palette colors (accessible under theme.palette. ): ... Having it is optional. error - used to represent interface elements...
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
That is the result I’d expect, but not the result I’m getting in my app. I’ll continue to investigate and follow-up here.
Thanks for your help so far!
Hi,
Could you give a try with the latest Next.js, react-dom and React version?