Skip to content

Body background color does not change when using "dark" theme #2370

@SaadBazaz

Description

@SaadBazaz

Description

The background color of the document's body should automatically update if I select the "dark", "night" or similar themes.

I don't know if this is expected behaviour. If it isn't, I'd certainly want it to be.

This is what I see in normal mode:
Screenshot 2022-09-24 at 10 40 22 AM

But this is what I see if I simply use colorMode={"dark"}:
Screenshot 2022-09-24 at 10 41 49 AM

However, if I manually set backgroundColor: "black" in index.css, it looks good:
Screenshot 2022-09-24 at 10 42 37 AM

Steps to reproduce

  1. Create a fresh React app through create-react-app
  2. Install primer
  3. Add ThemeProvider to App.js
  4. Use the "dark" theme

Version

v35.10.0

Browser

Chrome, Safari

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreact

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions