Skip to content

Fix/theme toggle - #337

Open
shivanshshri wants to merge 14 commits into
OpenScienceLabs:mainfrom
shivanshshri:fix/theme-toggle
Open

shivanshshri wants to merge 14 commits into
OpenScienceLabs:mainfrom
shivanshshri:fix/theme-toggle

Conversation

@shivanshshri

@shivanshshri shivanshshri commented Nov 24, 2026 •

Copy link
Copy Markdown

This PR improves the theme toggle functionality on the OpenScience Labs website, allowing users to switch between light and dark modes.

Changes Made:

Modified the existing theme toggle button.

Improved the theme-switching functionality.

Ensured users can switch between light and dark themes smoothly.

Testing:

Tested switching from light mode to dark mode.

Tested switching from dark mode to light mode.

Verified the changes using the local development server.

Screenshots:

BEFORE:

Screenshot 2026-11-24 195313

Light Mode

Screenshot 2026-11-24 195328

Dark Mode

AFTER:

Screenshot 2026-11-25 185402
Light Mode
Screenshot 2026-11-25 185415
Dark Mode

@netlify

netlify Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

👷 Deploy request for opensciencelabsweb pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 139f752

@shivanshshri

Copy link
Copy Markdown
Author

Hi @xmnlab , this PR is ready for review. All checks are green
(the deploy job is skipped on PRs, as expected).

Besides the theme toggle fix, I had to fix a few CI problems that were
blocking the checks:

  1. build job: mkdocs-rss-plugin crashed with IndexError in
    commit_count because git for-each-ref returned nothing in the runner's
    checkout. I set fetch-depth: 0 on actions/checkout.
  2. linkcheckmd hook: the script used os._exit(1), which discarded its
    own output, so failures showed no URLs. It now uses sys.exit(1). I also
    fixed the exception-URL logic and added twitter.com (403 to bots) and
    ignored 202 responses.
  3. ruff: removed an unused import and fixed formatting.

Could you take a look? One thing I'd like your opinion on: <e.g. whether the
fetch-depth: 0 change should live in this PR or a separate one / whether
to keep the debug step>.

Thanks!

@xmnlab

xmnlab commented Nov 25, 2026

Copy link
Copy Markdown
Member

hi @shivanshshri
thanks for working on that.

please keep your PR canges as minimum as possible. you are touching things that is not related to the main issue you are fixing.

please update your pr and ping me again, so i can give it a proper review.

appreciate it

@shivanshshri

shivanshshri commented Nov 25, 2026 •

Copy link
Copy Markdown
Author

hi @xmnlab ,
I undid irrelevant changes that were not concerned as per the issue description. Kindly once view the changes made and let me know if anything else needs to be changed.

While working on it I hit two CI problems that are unrelated to this change,
so I left them out of this PR:

  1. Build job: it fails on PRs with an IndexError from mkdocs-rss-plugin.
    The checkout uses a bare commit SHA, so the runner has no git refs and the
    plugin crashes on the empty output. Adding fetch-depth: 0 to the build
    job's checkout in main.yaml fixes it.
  2. linkcheckmd hook: scripts/check-broken-links-md.py uses
    os._exit(1), which discards its output, so failures show no URLs. It also
    fails on Twitter 403s.

Would you like me to open a separate PR for these two fixes? I can split them
into one PR each if you prefer.
Thank You for reviewing!

This branch has not been deployed

No deployments
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