material-ui styles div code example
Example 1: material ui common styles
const useStyles = makeStyles({
root: {
color: 'red',
'& p': {
color: 'green',
'& span': {
color: 'blue'
}
}
},
});
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}`} />
}