material ui set custom style code example
Example 1: adding style to root material ui
<Button
classes={{
root: classes.root,
label: classes.label,
}}
>
classes nesting
</Button>
Example 2: material ui common styles
const useStyles = makeStyles({
foo: props => ({
backgroundColor: props.backgroundColor,
}),
bar: {
color: props => props.color,
},
});
function MyComponent() {
const props = { backgroundColor: 'black', color: 'white' };
const classes = useStyles(props);
return <div className={`${classes.foo} ${classes.bar}`} />
}