I created my custom theme, and I'm trying to style the Tabs
and Tab
Material UI component. But the Tab Component is a ButtonBase
, and as I don't want all buttons to be overriden, I tried to override nested object styles like this:
MuiTabs: {
root: {
// Section being applied correctly
borderRadius: 3,
padding: 0,
minHeight: 32,
backgroundColor: theme.button.backgroundDisabled,
// NOT being applied
MuiButtonBase: {
root: {
backgroundColor: 'red',
},
},
},
}
the MuiButtonBase-root
style is not being applied. Can I do that without using string styles like this?
MuiTabs: {
root: {
....
// This IS being applied.
'& .MuiButtonBase-root': {
backgroundColor: 'red',
},
},
}
Is there any way to apply the first approach and not string styling?
classes
, but theTabs
component doesn't expose the tabButton ruleName to override so in your case, the answer is no. – NearHuscarl