docsify-dark-mode-toggle 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +18 -0
- package/package.json +5 -11
- package/CHANGELOG.md +0 -25
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright © 2026 Piotr Kowalski
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the “Software”), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -12,6 +12,20 @@ respects `prefers-color-scheme`, and persists the user's choice in `localStorage
|
|
|
12
12
|
|
|
13
13
|
Works just as well in any plain HTML page — Docsify is not required.
|
|
14
14
|
|
|
15
|
+
| Light | Dark |
|
|
16
|
+
| -------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
17
|
+
|  |  |
|
|
18
|
+
|
|
19
|
+
## Features ✨
|
|
20
|
+
|
|
21
|
+
- 🌓 One-click toggle between light and dark palettes
|
|
22
|
+
- 🪶 Zero dependencies - plain vanilla JS and CSS
|
|
23
|
+
- 🖥️ Respects the system `prefers-color-scheme` preference out of the box
|
|
24
|
+
- 💾 Persists the user's choice in `localStorage` (configurable storage key)
|
|
25
|
+
- 🌍 i18n button labels - built-in English and Polish, easy to extend
|
|
26
|
+
- 🎨 Custom sun/moon SVG icons and themeable CSS custom properties
|
|
27
|
+
- 📄 Works in any plain HTML page - Docsify is not required
|
|
28
|
+
|
|
15
29
|
## Installation
|
|
16
30
|
|
|
17
31
|
### Via CDN (recommended for Docsify sites)
|
|
@@ -118,6 +132,10 @@ You can also place your own `<button class="dark-mode-toggle">` in the markup
|
|
|
118
132
|
- The script reacts to `prefers-color-scheme` changes only while the user has
|
|
119
133
|
not made an explicit choice.
|
|
120
134
|
|
|
135
|
+
## Contributing
|
|
136
|
+
|
|
137
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
138
|
+
|
|
121
139
|
## License
|
|
122
140
|
|
|
123
141
|
[The MIT License](https://piecioshka.mit-license.org) @ 2026
|
package/package.json
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docsify-dark-mode-toggle",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "1.0.
|
|
3
|
+
"description": "Dark mode toggle button for Docsify - vanilla JS, no dependencies, configurable storage key, i18n, custom SVG icons.",
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Piotr Kowalski",
|
|
8
8
|
"email": "piecioshka@gmail.com",
|
|
9
9
|
"url": "https://piecioshka.pl/"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"release:major": "commit-and-tag-version --release-as major",
|
|
14
|
-
"release:minor": "commit-and-tag-version --release-as minor",
|
|
15
|
-
"release:patch": "commit-and-tag-version --release-as patch"
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"commit-and-tag-version": "^12.7.3"
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=20"
|
|
19
13
|
},
|
|
20
14
|
"repository": {
|
|
21
15
|
"type": "git",
|
|
@@ -27,7 +21,7 @@
|
|
|
27
21
|
"files": [
|
|
28
22
|
"index.js",
|
|
29
23
|
"index.css",
|
|
30
|
-
"
|
|
24
|
+
"LICENSE"
|
|
31
25
|
],
|
|
32
26
|
"keywords": [
|
|
33
27
|
"docsify",
|
package/CHANGELOG.md
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [1.0.1](https://github.com/piecioshka/docsify-dark-mode-toggle/compare/v1.0.0...v1.0.1) (2026-05-30)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
### Fixed
|
|
12
|
-
|
|
13
|
-
* make sun icon hollow ([f224184](https://github.com/piecioshka/docsify-dark-mode-toggle/commit/f224184388091a533ae38c449dbd8877e6350785))
|
|
14
|
-
|
|
15
|
-
## [1.0.0] - 2026-05-28
|
|
16
|
-
|
|
17
|
-
### Added
|
|
18
|
-
|
|
19
|
-
- Initial public release.
|
|
20
|
-
- Floating dark mode toggle button with sun/moon SVG icons.
|
|
21
|
-
- Respects `prefers-color-scheme: dark` for first-visit default.
|
|
22
|
-
- Persists user choice in `localStorage` (key configurable via `$docsify.darkMode.storageKey`).
|
|
23
|
-
- Built-in English and Polish labels; merge or override via `$docsify.darkMode.messages`.
|
|
24
|
-
- Customizable icons via `$docsify.darkMode.sunIcon` / `moonIcon` (SVG string or `SVGElement`).
|
|
25
|
-
- CSS custom properties on `:root` and `html.dark-mode` for easy palette overrides.
|