-
-
Notifications
You must be signed in to change notification settings - Fork 355
feat: add 'system' inside the theme toggle #766
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
Conversation
✅ Deploy Preview for hugo-hextra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This comment was marked as outdated.
This comment was marked as outdated.
|
thanks for picking it up and working on this. I like the addition of the system option and your thought about the cycle logic. |
|
I based the implementation on the current approach because, for me, it's simpler to use than a menu. If you prefer a menu, I can try to do it. |
|
I updated the implementation to use a menu. Tested inside the sidebar footer, the navbar, on mobile/small screen, and RTL/LTR. |
00ddc15 to
d853a21
Compare
Oh that was fast! I was just about to ask if you need any help or not 😆 I will take a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works perfect now! 👍
|
I detected a problem: there is a flash (quick switch light/dark) when switching between some pages. I think I know why. I will try to fix that. |
Adds a 'system' option to the theme toggle.
I created a "smart" cycle depending on the current
prefers-color-scheme.prefers-color-scheme: light: system -> dark -> light -> systemprefers-color-scheme: dark: system -> light -> dark -> systemThe next theme after
systemis always the opposite ofprefers-color-scheme.I created, by hand, an icon
contrastfor the itemsysteminside the theme toggle.This icon follows the heroicons style.
Tested inside the sidebar footer, the navbar, and on mobile/small screen.
Fixes #242