tutors-sdk / tutors

The core Tutors Reader application.
https://tutors.dev
MIT License
107 stars 38 forks source link

Themes don't work on homepage #779

Open MaximKirsch opened 1 month ago

MaximKirsch commented 1 month ago

Themes don't work on the Homepage for some reason.

Steps to reproduce:

-Go to Homepage (tutors.dev) -Click Themes in the upper right corner -Change Theme (Not Dark and Lightmode)

-Nothing changes.-

edeleastar commented 1 month ago

Thanks @MaximKirsch - yes, good spot. Will address

lgriffin commented 3 weeks ago

@edeleastar a little help on the debugging side of it as I get lost in CSS / Svelte :) There wasn't any obvious debugging so I saw in stores.ts that it hardcodes the storeTheme variable to tutors, I made a small change: let initialTheme = "tutors"; // Default value export const setInitialTheme = (theme: string) => { initialTheme = theme; };

export const storeTheme = localStorageStore("storeTheme", initialTheme);

and I can see the right theme name propagating through. This might have been propogating anyway but I think you should consider such a change in case that hard coding causes issues in user generated apps. Might be totally unnecessary but you know this better than I do.

In icon-lib.ts you have a subscribe to the storeTheme and I can see the right variable name makes it this far. My guess is here you need to do a CSS swaparoo to load the correct theme on the value change. That's as far as my skills will take me, I reckon it's a quick fix though

edeleastar commented 3 weeks ago

Thanks @lgriffin - will try this today….