MuiButtonBase-root override MuiButton-root
See original GitHub issueI have a component where I override Button root class, but ButtonBaseRoot is overriding my styles.
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
ButtonBaseRoot style is overriding Button given classes.
Expected Behavior 🤔
Classes given to Button should override all button styles
Steps to Reproduce 🕹
import { Button } from '@material-ui/core';
import { makeStyles } from '@material-ui/styles';
import React from 'react';
const useStyles = makeStyles({ root: { backgroundColor: 'red' } });
const MyButton = (props) => {
const classes = useStyles();
return <Button classes={classes} {...props} />;
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:13
- Comments:21 (4 by maintainers)
Top Results From Across the Web
MuiButtonBase-root override MuiButton-root · Issue #27149
I have a component where I override Button root class, but ButtonBaseRoot is overriding my styles. The issue is present in the latest...
Read more >Material ui contained button styling being overidden by ...
Upon further investigation I found out the the .MuiButton-containedPrimary style is being overidden by the .MuiButtonBase-root styling as seen ...
Read more >How to customize - Material UI
Overriding nested component styles First, use your browser's dev tools to identify the class for the component slot you want to override. The...
Read more >Is it possible to have root buttons styles override all others?
Something I assumed when changing the Material UI button theming is that root styles should be the "source of truth" and override all...
Read more >4 Ways to Override Material UI Styles | by John Au-Yeung
Material UI offers more than just a single way to override its ... all the styles that we want to apply in the...
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
I’m still with this problem after upgrading to mUI 5, but the weird thing is that it happens only in some pages, not all.
Anyone found a solution?
Noticed the error with
@mui/material
5.1.0 as well.