Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Themes don't work on homepage #779

Open
MaximKirsch opened this issue Jun 18, 2024 · 3 comments
Open

Themes don't work on homepage #779

MaximKirsch opened this issue Jun 18, 2024 · 3 comments
Assignees

Comments

@MaximKirsch
Copy link

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
Copy link
Contributor

Thanks @MaximKirsch - yes, good spot. Will address

@lgriffin
Copy link
Contributor

@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
Copy link
Contributor

Thanks @lgriffin - will try this today….

@edeleastar edeleastar moved this from Triage to Done in Tutors Jan 1, 2025
@edeleastar edeleastar self-assigned this Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants