Open metonym opened 2 years ago
I would also love to see this available in SvelteKit. Thanks!
@MatousAc Does this library not work for you in SvelteKit?
Hmm, I'm honestly kinda new to Svelte. But I guess maybe the problem wasn't that I was using sveltekit, but that I was trying your example in TypeScript rather than JavaScript. I'll try that out now that I have reconsidered the problem.
I'm pretty sure that the problem is that I am using a custom-typed (TS) svelte store for my theme variable. That just doesn't seem to be compatible with this library. Kinda makes sense. At this point, I'm doing most of it myself anyways, so I might as well detect the user's OS preferences too.
With unit tests in place, we can more confidently refactor the code to TypeScript. In addition to greater type safety, this would conserve the manual effort of syncing type definitions.
SvelteKit package is probably the best option to do this.