tutors-sdk / tutors

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

Themes don't work on homepage #779

Open MaximKirsch opened 5 months ago

MaximKirsch commented 5 months 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 5 months ago

Thanks @MaximKirsch - yes, good spot. Will address

lgriffin commented 4 months 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 4 months ago

Thanks @lgriffin - will try this today….