Looking to customize the font size for MuiTab using CSS overrides.
While following the material-ui documentation for CSS overrides, I successfully adjusted the font size for most elements. However, I encountered an issue with elements that utilize media queries, as they generate more specific CSS rules than my overrides.
In my theme.ts file:
import { createMuiTheme } from '@material-ui/core';
const fontSizeStyle = {
fontSize: '1rem',
};
const fontFamilyStyle = {
fontFamily: '"Ubuntu", sans-serif'
};
const theme = createMuiTheme({
overrides: {
MuiTab: {
root: {
...fontFamilyStyle,
...fontSizeStyle,
},
label: fontSizeStyle,
},
}
});
export default theme;
The resulting CSS rules applied to a MuiTab are shown here.
The specific rule causing the trouble is located in this file: https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Tab/Tab.js
[theme.breakpoints.up('md')]: {
fontSize: theme.typography.pxToRem(13),
},
Is there a way to override this media query using the createMuiTheme function without knowing the breakpoints? Should I specify breakpoints in order to use them in my overrides?
Thanks in advance!