Skip to content

Allow dark/light theme switch on user browser #2900

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

Merged
merged 2 commits into from
Mar 16, 2025

Conversation

SijieFu
Copy link
Contributor

@SijieFu SijieFu commented Mar 13, 2025

  1. New fearture: dark/light theme toggle on the webpage with user preference. Solves toggle between dark and light mode #911.
    • html[data-theme="dark"] selector to overwrite default light theme variables.
    • localStorage to store user preference of the theme. This is for theme consistency. User preference overwrites the default theme at compile.
  2. Fix: Navigation text overflow and wide empty spaces on mobile screens (or width-limited screens).
    • Deprecated $masthead-height to position the sidebar and the main body below the navbar. When the site title is long, this causes overflow to the fixed height. $masthead-height definition is still kept as a backup.
    • The navbar height is set to fit-content and the padding-top for the sidebar and the main body is updated together with updateNav() function.
    • Minor updates to related padding/margin to fix large empty spaces.

@rjzupkoii
Copy link
Collaborator

Thanks for the pull request and hard work to get this running!

@rjzupkoii rjzupkoii merged commit 89773fc into academicpages:master Mar 16, 2025
Tatwik19 pushed a commit to Tatwik19/Tatwik19.github.io that referenced this pull request Mar 19, 2025
Allow dark/light theme switch on user browser
georgiagracetully pushed a commit to georgiagracetully/georgiagracetully.github.io that referenced this pull request May 1, 2025
Allow dark/light theme switch on user browser
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.

2 participants