@alexandregme/zljs 3.23.0 → 3.23.1
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/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,12 @@ A change that needs action in an app has a **Migration** note. When updating, re
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [3.23.1] - 2026-11-25
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- Choosing the light or the dark theme changed nothing in an app built by Next.js for production: only the theme of the system worked. That build rewrites `light-dark()` into two variables it switches by itself, and the choice only set `color-scheme`. The choice now sets those variables too, so the theme buttons, `useTheme` and `setTheme` work there. Nothing to change in the app: update and build again
|
|
16
|
+
|
|
11
17
|
## [3.23.0] - 2026-11-24
|
|
12
18
|
|
|
13
19
|
### Added
|
|
@@ -662,7 +668,8 @@ Replace the shade with the class of the `color` being tested, for example `/(^|\
|
|
|
662
668
|
|
|
663
669
|
The message of `Error` is `text-zl-danger`. `none` and `ghost` didn't change.
|
|
664
670
|
|
|
665
|
-
[Unreleased]: https://github.com/alexandregme/zljs/compare/v3.23.
|
|
671
|
+
[Unreleased]: https://github.com/alexandregme/zljs/compare/v3.23.1...HEAD
|
|
672
|
+
[3.23.1]: https://github.com/alexandregme/zljs/compare/v3.23.0...v3.23.1
|
|
666
673
|
[3.23.0]: https://github.com/alexandregme/zljs/compare/v3.22.0...v3.23.0
|
|
667
674
|
[3.22.0]: https://github.com/alexandregme/zljs/compare/v3.21.0...v3.22.0
|
|
668
675
|
[3.21.0]: https://github.com/alexandregme/zljs/compare/v3.20.0...v3.21.0
|
|
@@ -463,7 +463,11 @@ import { useSyncExternalStore as useSyncExternalStore3 } from "react";
|
|
|
463
463
|
var themes = ["system", "light", "dark"];
|
|
464
464
|
var THEME_STORAGE_KEY = "zljs-theme";
|
|
465
465
|
var THEME_STYLE_ID = "zljs-theme";
|
|
466
|
-
var
|
|
466
|
+
var THEME_RULES = {
|
|
467
|
+
light: ":root:root{color-scheme:light;--lightningcss-light:initial;--lightningcss-dark: }",
|
|
468
|
+
dark: ":root:root{color-scheme:dark;--lightningcss-light: ;--lightningcss-dark:initial}"
|
|
469
|
+
};
|
|
470
|
+
var themeScript = `(function(){try{var r=${JSON.stringify(THEME_RULES)},t=localStorage.getItem("${THEME_STORAGE_KEY}");if(t==="light"||t==="dark"){var s=document.createElement("style");s.id="${THEME_STYLE_ID}";s.textContent=r[t];document.head.appendChild(s)}}catch(e){}})()`;
|
|
467
471
|
|
|
468
472
|
// features/app/hooks/use-theme/use-theme.ts
|
|
469
473
|
var SYSTEM = "system";
|
|
@@ -491,7 +495,7 @@ var applyTheme = (theme) => {
|
|
|
491
495
|
const existing = document.getElementById(THEME_STYLE_ID);
|
|
492
496
|
const style = existing ?? document.createElement("style");
|
|
493
497
|
style.id = THEME_STYLE_ID;
|
|
494
|
-
style.textContent = theme === SYSTEM ? "" :
|
|
498
|
+
style.textContent = theme === SYSTEM ? "" : THEME_RULES[theme];
|
|
495
499
|
if (!existing) {
|
|
496
500
|
document.head.append(style);
|
|
497
501
|
}
|
package/dist/index.js
CHANGED
package/dist/next/index.js
CHANGED