0

Let's say that my light theme has 2 different background (f.e. bg1, bg2). When I switch to a dark theme I want to apply new colors for those bg's. Is there any way how can I do that?

The problem is that in the default theme bg is #fafafa, and paper is white. I want to have the default bg white, and apply #fafafa as a background color only when I use paper. Now I have to hardcode #fafafa in every child component that uses paper. I want to get a custom color from theme, f.e theme.palette.mybg

const themeLight = createMuiTheme({
  palette: {
    background: {
      default: 'white',
    },
  },
});
Ryan Cogswell
  • 75,046
  • 9
  • 218
  • 198
Petr Schukin
  • 170
  • 2
  • 12

0 Answers0