Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I can't change the global background material ui

the material ui libraries have a white global background by default at startup, I tried to change it to red, but it doesn’t work. How can it be changed? the default is a white background, I want to make a different color

   MuiDivider: {
              styleOverrides: {
                  root: {
                   backgroundColor:"#cc5a5a",
                    },
                  },
                },

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I think you should import ‘makeStyles’ to be able to change the background. You can try this one:

import { makeStyles } from "@material-ui/core/styles";

const useStyles = makeStyles((theme) => ({
 root: {
  borderColor: "#cc5a5a",
  backgroundColor:"#cc5a5a",
 }
}));

export default function Sample() {
 const classes = useStyles();

 return (
  <div className={classes.root}>...</div>
 )
}

Also do try to do some research in the future before posting a question here.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading