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

Fix dark font on dark background by default #103

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Conversation

floscher
Copy link
Contributor

Fixes #102

@floscher floscher requested a review from thooyork November 26, 2024 16:49
@@ -67,7 +67,17 @@ export function saveCssPreference(css: UserTheme) {
}

export function loadCssPreference(): UserTheme {
return loadFromStorageAsString(window.localStorage, "cssTheme", "lightTheme") as UserTheme;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The culprit was the default value for UserTheme, which was "lightTheme" instead of "light".

I rewrote this a bit, so Typescript will make sure through the type system that only "light" or "dark" can be returned (also covers cases where some different string is saved in localStorage).

@thooyork thooyork merged commit a2842ac into main Nov 27, 2024
18 checks passed
@floscher floscher deleted the fix/dark-font-darkmode branch November 27, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default theme is dark with dark font
2 participants