I am trying to style my pahe using makeStyles from material ui with react js. it is working for me with some pages, but most of them are not working even if I am using the same styling elements like tha backgroundColor. in the code below, only pageTitle that is working.
import { Card, Paper, Typography } from '@mui/material'
import { makeStyles } from '@mui/styles';
import React from 'react'
const useStyles = makeStyles(theme => ({
root:{
backgroundColor:'#fdfd'
},
pageHeader:{
padding:theme.spacing(4),
display:'flex',
marginBottom:theme.spacing(3)
},
pageIcon:{
display: 'inline-block',
padding: theme.spacing(2),
color:'#AE431E'
},
pageTitle:{
paddingLeft: theme.spacing(4),
'& .MuiTypography-subtitle2':{
opacity: '0.5'
}
}
}))
export default function PageHeader(props) {
const classes = useStyles();
const {title,subtitle,icon} = props;
return (
<Paper className={classes.root} elevation={0} square >
<div classeName={classes.pageHeader}>
<Card className={classes.pageIcon}>
{icon}
</Card>
<div className={classes.pageTitle}>
<Typography
variant="h6"
component="div"
>{title}</Typography>
<Typography
variant="subtitle2"
component="div"
>{subtitle}</Typography>
</div>
</div>
</Paper>
)
}