user1334609
user1334609

Reputation: 431

Failed to change the appbar backgroud color

I use https://codesandbox.io/s/github/SabuShakya/React-Sidebar-Using-Material-UI/ one as reference, i want to update the background of appbar to #ffb74d,

I have checked lots of answers, the answer works for me in other project I tried,but the same method can't help in this one, I don't know what's wrong here

The following code is what I added in MiniDrawer.js, it doesn't work as expected

    const theme = createMuiTheme({
      palette: {
        primary: {
          // Purple and green play nicely together.
          main: '#0fb7ae',
        },
        secondary: {
          // This is green.A700 as hex.
          main: '#11cb5f',
        },
      },
    });


....
            <ThemeProvider theme={theme}>
            <AppBar
                position="fixed"
                color={theme.palette.primary.main}
.......

Anyone help me out ?

Upvotes: 1

Views: 46

Answers (1)

Cognisun Inc
Cognisun Inc

Reputation: 446

You can try this for Appbar background color

enter image description here

Upvotes: 2

Related Questions