Replies: 2 comments
-
Solid does not have a theme provider but provides a way to create a theme provider. What you are trying to do is to use a context value to pass data, a JavaScript object with CSS values, to downstream components. Since code has no issue but you don't know how it works, it is best for you to learn how solid works, how context API fits into its reactive system. You can check out this answer for it: https://stackoverflow.com/a/74492899/7134134 |
Beta Was this translation helpful? Give feedback.
-
I've created a bounty for this question on StackOverflow, you can see it here. |
Beta Was this translation helpful? Give feedback.
-
I'm kind of new to SolidJS, and now I'm trying to work out how SUID's
ThemeProvider
differs from SolidJS's (e.g. this docs provider/context example). A simple example would be how to switch between light and dark modes from a child component. What's the proper way?I've tried something like this so far, but it hasn't worked, I thought signal reactivity would be enough, but I think I'm misunderstanding a core concept somewhere.
If the example below is successful, then the background should switch between black and white.
Beta Was this translation helpful? Give feedback.
All reactions