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

Theme switcher #246

Merged
merged 3 commits into from
Sep 19, 2024
Merged

Theme switcher #246

merged 3 commits into from
Sep 19, 2024

Conversation

allevo
Copy link
Contributor

@allevo allevo commented Sep 17, 2024

Implementazione del theme switcher a fianco della search.
Comportamento:

  • al primo caricamento usa il tema di sistema: se è dark configura il sito con dark, altrimenti con light. Su browser che non supporta il window.matchMedia usa il tema light.
  • a click viene effettuata l'inversione di tema
  • il sito si ricorda il tema scelto salvando la preferenza nel localStorage
  • funzione solo se hai il JS attivo sul browser

I colori del tema dark sono quelli di default di just-the-docs.
Se il localStorage non è definito, non viene salvata la preferenza.
Le icone sono generate da chatGPT.

Riporto gli screenshot qui sotto:
Screenshot 2024-09-17 at 10 23 38
Screenshot 2024-09-17 at 10 23 58

Copy link
Contributor

@guizzo guizzo left a comment

Choose a reason for hiding this comment

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

LGTM

@Cadienvan Cadienvan merged commit d10e1f1 into main Sep 19, 2024
1 check passed
@Cadienvan Cadienvan deleted the feat/dark-theme-switcher branch September 19, 2024 19:05
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.

3 participants