Skip to content

useRootStyles: false disables whole theme #2516

@pietrofxq

Description

@pietrofxq

Describe the bug
When using useRootStyles: false, the default theme is not returned and variables in components do not work. The issue is here:

if (!colors || useRootStyles === false) return {}

I am not sure if we need to check useRootStyles at all here, the documentation says this property is only to avoid applying styles in the html, not that it would prevent the color mode from working

To Reproduce
Steps to reproduce the behavior:

  1. set useRootStyles: false in theme
  2. try to access a variable in a component, or check the devtools:
    image

Expected behavior
useRootStyles: false should not prevent variables from being defined

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