Skip to content

Struggling with theme-aware global styles #1438

Answered by lachlanjc
jenkshields asked this question in Q&A
Discussion options

You must be logged in to vote

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. primary is the same in all color modes), then you could just remove the theme => part inside Global, since the theme variable 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!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hasparus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants