docsify-dark-mode-toggle 1.0.2 → 1.0.4

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.
Files changed (3) hide show
  1. package/README.md +8 -0
  2. package/index.css +16 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -12,6 +12,10 @@ 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
+ | ![docsify-dark-mode-toggle - demo, light](docs/screenshots/demo-light.png) | ![docsify-dark-mode-toggle - demo, dark](docs/screenshots/demo-dark.png) |
18
+
15
19
  ## Features ✨
16
20
 
17
21
  - 🌓 One-click toggle between light and dark palettes
@@ -128,6 +132,10 @@ You can also place your own `<button class="dark-mode-toggle">` in the markup
128
132
  - The script reacts to `prefers-color-scheme` changes only while the user has
129
133
  not made an explicit choice.
130
134
 
135
+ ## Contributing
136
+
137
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
138
+
131
139
  ## License
132
140
 
133
141
  [The MIT License](https://piecioshka.mit-license.org) @ 2026
package/index.css CHANGED
@@ -39,6 +39,8 @@ html.dark-mode {
39
39
  --dm-tip-bg: var(--dm-bg-elevated);
40
40
  --dm-summary-bg: var(--dm-bg-elevated);
41
41
  --dm-search-input-bg: var(--dm-bg-elevated);
42
+ --dm-search-clear-bg: var(--dm-border);
43
+ --dm-search-clear-icon: var(--dm-text);
42
44
 
43
45
  background: var(--dm-bg);
44
46
  color: var(--dm-text);
@@ -61,7 +63,9 @@ html.dark-mode {
61
63
  display: flex;
62
64
  align-items: center;
63
65
  justify-content: center;
64
- transition: color 0.2s ease, opacity 0.2s ease;
66
+ transition:
67
+ color 0.2s ease,
68
+ opacity 0.2s ease;
65
69
  }
66
70
 
67
71
  .dark-mode-toggle:hover {
@@ -193,6 +197,17 @@ html.dark-mode .search input[type="search"] {
193
197
  border-color: var(--dm-border);
194
198
  }
195
199
 
200
+ /* Clear (x) button of the search input: Docsify draws it as an inline SVG
201
+ with a light gray circle and a white cross, which is barely visible on a
202
+ dark sidebar. CSS overrides the SVG presentation attributes. */
203
+ html.dark-mode .search .clear-button circle {
204
+ fill: var(--dm-search-clear-bg);
205
+ }
206
+
207
+ html.dark-mode .search .clear-button path {
208
+ stroke: var(--dm-search-clear-icon);
209
+ }
210
+
196
211
  html.dark-mode .search .results-panel {
197
212
  background: var(--dm-bg);
198
213
  color: var(--dm-text);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "docsify-dark-mode-toggle",
3
3
  "description": "Dark mode toggle button for Docsify - vanilla JS, no dependencies, configurable storage key, i18n, custom SVG icons.",
4
- "version": "1.0.2",
4
+ "version": "1.0.4",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "Piotr Kowalski",