Issue
I'm new to mui , i'm doing CSS in mui components like this
<Typography
variant="h5"
sx={{
fontWeight: "bold",
color: "#1a759f",
display: "flex",
justifyContent: "center",
margin: "20vh",
}}
>
Topology
</Typography>
but this is inline CSS which is not a good practice , tell me an alternative to that
Solution
Move to a variable
const styles = {
typographyStyle: {
fontWeight: "bold",
color: "#1a759f",
display: "flex",
justifyContent: "center",
margin: "20vh",
},
};
in the element
sx={[styles.typographyStyle]}
Answered By - Sachila Ranawaka
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.