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

Comply with the default_theme value for the first load of the website (when theme_switcher = true) #223

Closed
kbrault opened this issue Nov 24, 2023 · 2 comments · Fixed by #224
Labels
enhancement New feature or request

Comments

@kbrault
Copy link

kbrault commented Nov 24, 2023

Feature Request

Summary

When theme_switcher = true and default_theme = "light" --> the default theme loaded should be the light one.
In practice, even if the default_theme is light and theme_switcher is true, the dark theme is always loaded the first time (when cookies are empty).

Motivation

I wish the loaded theme would respects the default_theme value for the first load of the website.

@kbrault kbrault added the enhancement New feature or request label Nov 24, 2023
@kbrault kbrault changed the title Respects the default_theme value for the first load of the website (when theme_switcher = true) Comply with the default_theme value for the first load of the website (when theme_switcher = true) Nov 24, 2023
@welpo
Copy link
Owner

welpo commented Nov 24, 2023

Hi Kévin!

Thanks for requesting this feature. One note:

the dark theme is always loaded the first time (when cookies are empty)

This should only be the case if your system is using the dark theme. The current behaviour is to follow the OS preference when the theme switcher is enabled. If you switch to light theme, the site should also show the light theme. The default_theme is used as fallback when JS is disabled.

That said, you're right, it does make more sense to use the default_theme both when JS is disabled (current) as well as when it's enabled.

This will be a breaking change, but I think it's worth it.

Working on it!

@welpo
Copy link
Owner

welpo commented Nov 24, 2023

Done in #224.

Don't hesitate to reach out if you encounter any issues.

Thanks again for your report and for using tabi! 🫶

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants