tailwindcss-multi-theme
tailwindcss-multi-theme copied to clipboard
feat(integrations): Watch for changes to dark mode
👋 Hi, right now when people visit a website using the prefers-dark.js script, it'll only set the theme at the beginning when they load the page, so if they change their system theme afterward, it won't be updated on the site.
This pull request, which is modeled after https://github.com/ChanceArthur/tailwindcss-dark-mode/pull/34, fixes that by using the listener / observer feature of matchMedia.
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/ejmaito/tailwindcss-multi-theme/ber6ew8lx
✅ Preview: https://tailwindcss-multi-theme-git-fork-jakenavith-master.ejmaito.vercel.app
This pull request is being automatically deployed with Vercel (learn more). To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/ejmaito/tailwindcss-multi-theme/r9pjaqgkc ✅ Preview: https://tailwindcss-multi-theme-git-fork-jakenavith-master.ejmaito.vercel.app
By the way, you won't be able to see a difference on this automatically generated preview (very cool, by the way!) because you use Alpine code there instead of the prefers-dark script.
Similarly, because I don't know React, Vue, or Alpine, I can't update any of those examples (in the examples folder) to watch the system theme 😦 .