Theme-switcher for solid
I'm building my project using SolidJS, PandaCSS, and Park UI. I'm currently looking for a robust theme switcher, similar to "next-themes", to toggle between light and dark modes effectively.
https://github.com/pacocoursey/next-themes
If there's a SolidJS-friendly solution or best practice for managing color mode that integrates well with PandaCSS, I’d love to explore it. #helpasap
GitHub
GitHub - pacocoursey/next-themes: Perfect Next.js dark mode in 2 li...
Perfect Next.js dark mode in 2 lines of code. Support System preference and any other theme with no flashing - pacocoursey/next-themes
8 Replies
You can have a look at kobaltes Color Mode:
https://github.com/kobaltedev/kobalte/tree/main/packages/core/src/color-mode
GitHub
kobalte/packages/core/src/color-mode at main · kobaltedev/kobalte
A UI toolkit for building accessible web apps and design systems with SolidJS. - kobaltedev/kobalte
Will add
data-kbTheme="light"
to the html element. Stores the theme in a cookie (great for SSR to prevent flashing )
so your panda config should be somewhat
Though this doesn't answer the question directly, DaisyUI's theme handling is excellent with SolidJS.
There's also SolidUI
does this works with park-ui components? i try to do that ...but nothing happen
im using park-ui....cant use another ui component library...
it does create cookie ...but didnt get reflected.

How does Park UI switch themes? I am afk. I’ll have a look later. Maybe you just need to add a class to the body
if you have access to the css variables you can simply update the selectors like
otherwise you must add "light" / "dark" css class to the html element e.g.
oh yea, that is very simple to do!