docsify-dark-mode-toggle 1.0.0 → 1.0.2

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 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,16 @@ 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
+ ## Features ✨
16
+
17
+ - 🌓 One-click toggle between light and dark palettes
18
+ - 🪶 Zero dependencies - plain vanilla JS and CSS
19
+ - 🖥️ Respects the system `prefers-color-scheme` preference out of the box
20
+ - 💾 Persists the user's choice in `localStorage` (configurable storage key)
21
+ - 🌍 i18n button labels - built-in English and Polish, easy to extend
22
+ - 🎨 Custom sun/moon SVG icons and themeable CSS custom properties
23
+ - 📄 Works in any plain HTML page - Docsify is not required
24
+
15
25
  ## Installation
16
26
 
17
27
  ### Via CDN (recommended for Docsify sites)
package/index.js CHANGED
@@ -105,7 +105,7 @@
105
105
  }
106
106
 
107
107
  const defaultSunIcon = buildIcon([
108
- svgEl("circle", { cx: "12", cy: "12", r: "4", fill: "currentColor" }),
108
+ svgEl("circle", { cx: "12", cy: "12", r: "4" }),
109
109
  svgEl("line", { x1: "12", y1: "2", x2: "12", y2: "4" }),
110
110
  svgEl("line", { x1: "12", y1: "20", x2: "12", y2: "22" }),
111
111
  svgEl("line", { x1: "2", y1: "12", x2: "4", y2: "12" }),
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "docsify-dark-mode-toggle",
3
- "description": "🔨 Dark mode toggle button for Docsify — vanilla JS, no dependencies, configurable storage key, i18n, custom SVG icons.",
4
- "version": "1.0.0",
3
+ "description": "Dark mode toggle button for Docsify - vanilla JS, no dependencies, configurable storage key, i18n, custom SVG icons.",
4
+ "version": "1.0.2",
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
+ "engines": {
12
+ "node": ">=20"
13
+ },
11
14
  "repository": {
12
15
  "type": "git",
13
16
  "url": "git+https://github.com/piecioshka/docsify-dark-mode-toggle.git"
@@ -18,7 +21,7 @@
18
21
  "files": [
19
22
  "index.js",
20
23
  "index.css",
21
- "CHANGELOG.md"
24
+ "LICENSE"
22
25
  ],
23
26
  "keywords": [
24
27
  "docsify",
package/CHANGELOG.md DELETED
@@ -1,18 +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.0] - 2026-05-28
9
-
10
- ### Added
11
-
12
- - Initial public release.
13
- - Floating dark mode toggle button with sun/moon SVG icons.
14
- - Respects `prefers-color-scheme: dark` for first-visit default.
15
- - Persists user choice in `localStorage` (key configurable via `$docsify.darkMode.storageKey`).
16
- - Built-in English and Polish labels; merge or override via `$docsify.darkMode.messages`.
17
- - Customizable icons via `$docsify.darkMode.sunIcon` / `moonIcon` (SVG string or `SVGElement`).
18
- - CSS custom properties on `:root` and `html.dark-mode` for easy palette overrides.