-
Notifications
You must be signed in to change notification settings - Fork 15.2k
feat(theme): a11y and dark and light theme changes #54238
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
base: main
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @rajramo61! |
✅ Pull request preview available for checkingBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Pull request preview available for checkingBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
This pr covers the issue #25061
Description
This pull request introduces a comprehensive theme toggle system for the website, allowing users to switch between light and dark modes with persistence, accessibility, and internationalization support. The implementation includes a new JavaScript theme toggle handler, a toggle button in the navigation bar, updated SCSS for theme variables and consistent styling, and translation strings for multiple languages.
The most important changes are:
Theme Toggle Functionality:
theme-toggle.jsscript that manages theme switching, system preference detection, localStorage persistence, updates to UI (including Mermaid diagrams), and exposes a public API for theme control.head.htmlto prevent flashes of the wrong theme before the page renders.theme-toggle.html) and included it in the navigation bar. The button updates its icon and ARIA labels based on the current theme and is internationalized. [1] [2]Styling and Theme Variables:
Internationalization:
Build Integration:
theme-toggle.jsscript is included in the main JavaScript bundle by updating the scripts partial.Issue
Closes: #25061