You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
first of all, awesome project, thanks for that.
But for all the praise I too have an improvement idea.
The current dark mode implementation purely bases on javascript execution in the browser.
This is a bit unfortunate, as some frameworks or tools such as SvelteKit expressly define themselves as being useable without frontend js execution.
This could be fixed rather easily by changing the dark mode configuration in the tailwind config from this:
...
constconfig={darkMode: ["class"],// from thiscontent: ["./src/**/*.{html,js,svelte,ts}"],safelist: ["dark"],theme: {
...
I don't think this library is usable without JavaScript.
Right, I have not thought of that...
I disabled js for testing and the rendering looked mostly fine, the functionality was limited, sure, but most still worked.
If people here don't use this feature, the request might be irrelevant.
Although I do think this is a more sane solution for doing the system default theme query in general.
I'm pretty sure JS would be required to get all the functionality that mode-watcher provides, which extends beyond just the system. This is great but doesn't cover the conversion of scrollbars and other native elements into the "application selected" theme, so you may end up with light-mode scrollbars on a dark-mode app and vice versa.
You can feel free to implement this yourself in your apps though! mode-watcher isn't forced on you to use, just there if you wish!
Hi,
first of all, awesome project, thanks for that.
But for all the praise I too have an improvement idea.
The current dark mode implementation purely bases on javascript execution in the browser.
This is a bit unfortunate, as some frameworks or tools such as SvelteKit expressly define themselves as being useable without frontend js execution.
This could be fixed rather easily by changing the dark mode configuration in the tailwind config from this:
to this
as mentioned in the tailwind docs: https://tailwindcss.com/docs/dark-mode#using-multiple-selectors
As far as my testing goes, this does not have any adverse effects.
Regards
hibatos
The text was updated successfully, but these errors were encountered: