Lancer11211

Results 4 comments of Lancer11211

I'm struggling with the theming for many hours. I've this: ``` {#if $isDarkMode} {:else} {/if} ``` but it doesn't matter where I put the css files, svelte can't load it....

> This is how I do it: > > ```ts > > ``` > > J Thanks, that looks nice!

`document.documentElement.setAttribute("data-theme", "...");` is the most flexible solution I've found.

``` let isDarkMode = $user.isDarkMode; user.subscribe((value: any) => { isDarkMode = value.isDarkMode; if(browser) { if(isDarkMode) { document.documentElement.setAttribute("data-theme", "customdark"); } else { document.documentElement.setAttribute("data-theme", "customlight"); } } }); ``` like this.