https://github.com/robsd/js-toggle-dark-mode
A smart JavaScript application that automatically inherits the user's prefers-color-scheme, but allows it to be overridden by the user and stored in the user's browser storage to enable site-wide preference and future visits.
https://github.com/robsd/js-toggle-dark-mode
bootstrap bootstrap5 dark dark-mode dark-mode-toggle dark-mode-toggler dark-theme html html5 javascript js mode snippet theme toggle toggle-dark-mode toggler web
Last synced: about 2 months ago
JSON representation
A smart JavaScript application that automatically inherits the user's prefers-color-scheme, but allows it to be overridden by the user and stored in the user's browser storage to enable site-wide preference and future visits.
- Host: GitHub
- URL: https://github.com/robsd/js-toggle-dark-mode
- Owner: robsd
- License: mit
- Created: 2021-10-21T00:03:28.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-04-03T21:56:24.000Z (about 3 years ago)
- Last Synced: 2025-06-21T05:37:19.128Z (12 months ago)
- Topics: bootstrap, bootstrap5, dark, dark-mode, dark-mode-toggle, dark-mode-toggler, dark-theme, html, html5, javascript, js, mode, snippet, theme, toggle, toggle-dark-mode, toggler, web
- Language: JavaScript
- Homepage: https://robsd.github.io/js-toggle-dark-mode
- Size: 5.86 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# js-toggle-dark-mode 🌙
A smart JavaScript application that automatically inherits the user's prefers-color-scheme, but allows it to be overridden by the user and stored in the user's browser storage to enable site-wide preference and future visits.
## Installing on your own site
1. Copy the 3 `...` line which will display the toggle button if functionality is supported by the user's browser.
3. Copy the `