Struggling with theme-aware global styles #1438
-
|
Kia ora! I'm trying to use Here's the code: Using Next.js 10.0.5 and theme-ui 0.6.0-alpha.4 Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hey! My guess is that the issue is you're using the theme as a function, but outside the ThemeProvider which is providing the necessary Context. If you don't need the values to be context-aware (e.g. |
Beta Was this translation helpful? Give feedback.
Hey! My guess is that the issue is you're using the theme as a function, but outside the ThemeProvider which is providing the necessary Context. If you don't need the values to be context-aware (e.g.
primaryis the same in all color modes), then you could just remove thetheme =>part inside Global, since thethemevariable is already imported/defined. If you need the values to be context-aware, try moving the Global inside the ThemeProvider (instead of using the fragment). Let me know!