Skip to content

Conversation

ElshadHu
Copy link
Contributor

@ElshadHu ElshadHu commented Oct 1, 2025

Changes

Modified the theme toggle functionality to support three modes instead of two:

  • Updated useTheme.tsx to include system theme detection using window.matchMedia('prefers-color-scheme: dark')
  • Added dynamic listener to respond to OS/browser theme changes in real-time
  • Modified Theme.tsx to display appropriate icons for each mode (moon, sun, half-circle)
  • Incremented version in package.json from 2.2.1 to 2.3.0 according to semantic versioning

Why Needed

Users previously could only toggle between dark and light modes manually. This enhancement adds a system mode that automatically follows the user's OS/browser theme preference, providing a more seamless experience for users who have already configured their system-wide theme settings.

Closes #16

Testing

Verification can be made:

  • Click the theme toggle to go through all three options
  • In system mode, verify the website matches your OS/browser theme preference
  • Change your OS theme to confirm automatic updates (can be done via browser DevTools theme emulation)

@ElshadHu
Copy link
Contributor Author

ElshadHu commented Oct 1, 2025

Hi maintainers, thank you for reviewing this contribution. I'm participating in Hacktoberfest this October - would you consider adding the 'hacktoberfest' topic to this repository? Either way, I'm glad to contribute to the project.If there is an issue with PR, let me know.

@physicshub
Copy link
Owner

Hello, thank you for the pull request, I think it's completely fine and I'm going to merge it. As I've said to other contributors, the changes will be live as soon as I deploy the repo to gh pages, and I won't do so until the Google Translate system is fixed. I'll let you know when it's live. As for Hacktoberfest, I'll post the topic without any hesitation.

Thanks again for your invaluable help!

@physicshub physicshub merged commit 8f848d0 into physicshub:main Oct 1, 2025
@physicshub
Copy link
Owner

@all-contributors please add @ElshadHu code

Copy link
Contributor

@physicshub

I've put up a pull request to add @ElshadHu! 🎉

@physicshub
Copy link
Owner

I added you to the README contributors section. I invite you also to join our discord to get in touch with other contributors and get a special role. https://discord.gg/qsA9KvrNKk

@ElshadHu
Copy link
Contributor Author

ElshadHu commented Oct 1, 2025

Thank you so much for merging my PR and adding me to the contributors! I really appreciate it. I'll join the Discord server to connect with the team.

@physicshub
Copy link
Owner

Hello! Your changes are now live!

@ElshadHu
Copy link
Contributor Author

ElshadHu commented Oct 2, 2025

Awesome, thank you! Glad to see it live.

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.

Change switch theme behavior.
2 participants