Skip to content

initialColorMode in gatsby-plugin-theme-ui not working  #367

@juanhenriquez

Description

@juanhenriquez

When using the gatsby-plugin-theme-ui plugin with Gatsby, it is not using the initialColorMode in the /src/gatsby-plugin-theme-ui/index.js file, and instead, it is using the dark mode directly.

Take this theme as an example:

export default {
  initialColorMode: 'light',
  colors: {
    text: '#000',
    background: '#fff',
    primary: '#6e67ff',
    secondary: '#212121',
    modes: {
      dark: {
        text: '#fff',
        background: '#212121',
        secondary: '#fff',
      },
    },
  },
};

It should use the light mode as the default mode, but instead, it is using the dark mode with no reason.

Here is a reproduction of the issue: https://codesandbox.io/embed/gatsby-starter-default-qyqkp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions