question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Optional backgroundColor with CssBaseline

See original GitHub issue

Make it easy to turn off the backgroundColor setting when using CssBaseline with just a single boolean prop.

Everything else CssBaseline does is very sensible, but if I’m embedding my app in a page with some other color scheme going on, overriding the backgroundColor can be problematic.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

43reactions
skubecommented, Sep 9, 2019
  • changing the CssBaseline CSS with theme.overrides.MuiCssBaseline.body

For others that are as lost as I am, the above means:

const theme = createMuiTheme({
  overrides: {
    MuiCssBaseline: {
      '@global': {
        body: {
          backgroundColor: '#ff00ff',
        },
      },
    },
  },
})
22reactions
bzmillerboycommented, Jan 29, 2020

For anyone else how finds this: My issue was that I did not have the <CssBaseline /> nested inside the <ThemeProvider>.

https://stackoverflow.com/questions/48186478/custom-theme-background-color

Read more comments on GitHub >

github_iconTop Results From Across the Web

Optional backgroundColor with CssBaseline #12654 - GitHub
Make it easy to turn off the backgroundColor setting when using CssBaseline with just a single boolean prop.
Read more >
CSS Baseline - Material UI - MUI
The default Material Design background color is applied. It's using theme.palette.background.default for standard devices and a white background for print ...
Read more >
CssBaseline Overriding theme background colour MUI? Reactjs
I am using material ui to make a theme which works fine but when I add <CssBaseline/> to the App.js it turns the...
Read more >
Global Styling with Material-UI Theme Overrides and Props
Learn how to use global CSS overrides and default props in a theme to customize all instances of a Material-UI component in a...
Read more >
React-select selected option background color - CodeSandbox
CodeSandbox is an online editor tailored for web applications.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found