Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use non-hex values in theme.global.colors.background #7159

Open
Tbhesswebber opened this issue Mar 8, 2024 · 0 comments
Open

Cannot use non-hex values in theme.global.colors.background #7159

Tbhesswebber opened this issue Mar 8, 2024 · 0 comments

Comments

@Tbhesswebber
Copy link
Contributor

Expected Behavior

I should be able to use CSS custom properties as values in theme.global.colors.background, without dark-mode being broken.

Actual Behavior

Setting theme.global.colors.background to anything besides a HEX value causes colorIsDark to return undefined, which then causes backgroundIsDark to return undefined. If you explicitly pass "dark" to the themeMode prop of the Grommet component, theme.dark is undefined.

URL, screen shot, or Codepen exhibiting the issue

N/A

Steps to Reproduce

  1. Set theme.global.colors.background to var(--colors-black, blue)
  2. Pass "dark" to the themeMode prop of the Grommet component
  3. Open React dev-tools and find the first ContextProvider below the Grommet component, expanding the theme value and scrolling down to the dark property. It should be undefined

Your Environment

  • Grommet version: 2.35.0
  • Browser Name and version: Chrome 122.0.6261.69
  • Operating System and version (desktop or mobile): Ubuntu 23 (desktop)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant