origam 2.26.1 → 2.26.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/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,12 @@ This project follows [Semantic Versioning](https://semver.org).
|
|
|
18
18
|
|
|
19
19
|
## [Unreleased]
|
|
20
20
|
|
|
21
|
+
## [2.26.2] - 2026-10-15
|
|
22
|
+
|
|
23
|
+
### Fixed — un theme sans `name` avec `mode` l'emporte sur la palette integree du meme mode (#1102)
|
|
24
|
+
|
|
25
|
+
`themeSelector({ mode: 'dark' })` emettait `[data-mode="dark"]` (0,1,0) face a `[data-mode="dark"]:not([data-theme="light"])` (0,2,0) de `dark.css` : le theme sombre sans nom perdait sur `theme=dark/mode=dark`, `mode=dark` seul et `theme=site/mode=dark` (mesure Chromium : `--origam-color__action--primary---bg` restait a `#7c3aed`). Il peignait aussi sombre sous `data-theme="light" data-mode="dark"` par egalite d'ordre source (regle #807 violee). Le selecteur est desormais `html[data-mode="…"]` (dark : `(0,2,1)`, `:not([data-theme="light"])` conserve ; light : `(0,1,1)`), independant de l'ordre d'injection, et reste sous les blocs `:root:root[data-theme]` des marques nommees. Le doc `theme.interface.ts` (« scoped to `:root` ») est corrige. Spec : `unnamed-theme-specificity.spec.ts`.
|
|
26
|
+
|
|
21
27
|
## [2.26.1] - 2026-10-14
|
|
22
28
|
|
|
23
29
|
### Fixed — `warnLegacyColor` : dev uniquement, et plus d'avertissement pour `var()` / `color-mix()` (#1099)
|
|
@@ -21,8 +21,11 @@ export interface IOrigamThemeSingletonState {
|
|
|
21
21
|
/**
|
|
22
22
|
* Runtime theme object ingested by `createOrigam({ themes })`. At install time
|
|
23
23
|
* the DS resolves it to a block of `--origam-*` CSS variables injected into
|
|
24
|
-
* `<head>`, scoped
|
|
25
|
-
*
|
|
24
|
+
* `<head>`, scoped by `name` / `mode` (see `themeSelector`):
|
|
25
|
+
* no `name` and no `mode` → `:root`; no `name` but a `mode` → `html[data-mode]`
|
|
26
|
+
* (plus a bare `[data-mode]` twin for sub-trees), specific enough to beat the
|
|
27
|
+
* built-in palette of that mode and still lose to every named brand (#1102);
|
|
28
|
+
* a `name` → `[data-theme="<name>"]`, optionally narrowed by `[data-mode]`.
|
|
26
29
|
*
|
|
27
30
|
* ## A theme has exactly THREE authoring surfaces
|
|
28
31
|
*
|
|
@@ -74,7 +74,11 @@ function themeSelector(theme) {
|
|
|
74
74
|
const hasName = typeof theme.name === "string" && theme.name.length > 0;
|
|
75
75
|
const hasMode = theme.mode === "light" || theme.mode === "dark";
|
|
76
76
|
if (!hasName && !hasMode) return ":root";
|
|
77
|
-
if (!hasName)
|
|
77
|
+
if (!hasName) {
|
|
78
|
+
const root = theme.mode === "dark" ? 'html[data-mode="dark"]:not([data-theme="light"])' : 'html[data-mode="light"]';
|
|
79
|
+
const subtree = theme.mode === "dark" ? '[data-mode="dark"]:not([data-theme]):not([data-theme="light"])' : '[data-mode="light"]:not([data-theme])';
|
|
80
|
+
return `${root}, ${subtree}`;
|
|
81
|
+
}
|
|
78
82
|
const modeAttr = hasMode ? `[data-mode="${theme.mode}"]` : "";
|
|
79
83
|
const attrs = `[data-theme="${theme.name}"]${modeAttr}`;
|
|
80
84
|
return `:root:root${attrs}, ${attrs}`;
|
|
@@ -27,7 +27,8 @@ export declare function resolveThemeVars(theme: IOrigamTheme): TThemeVars;
|
|
|
27
27
|
* Compute the CSS selector a theme block targets, from its `name` / `mode`:
|
|
28
28
|
* - neither → `:root`
|
|
29
29
|
* - name only → `[data-theme="<name>"]`
|
|
30
|
-
* - mode only → `[data-mode="<mode>"]`
|
|
30
|
+
* - mode only → `html[data-mode="<mode>"], [data-mode="<mode>"]:not([data-theme])`
|
|
31
|
+
* (dark adds `:not([data-theme="light"])`, see #1102)
|
|
31
32
|
* - name + mode → `[data-theme="<name>"][data-mode="<mode>"]`
|
|
32
33
|
*
|
|
33
34
|
* A `mode` of `'auto'` is treated as "no mode scoping".
|
|
@@ -55,7 +55,11 @@ export function themeSelector(theme) {
|
|
|
55
55
|
const hasName = typeof theme.name === "string" && theme.name.length > 0;
|
|
56
56
|
const hasMode = theme.mode === "light" || theme.mode === "dark";
|
|
57
57
|
if (!hasName && !hasMode) return ":root";
|
|
58
|
-
if (!hasName)
|
|
58
|
+
if (!hasName) {
|
|
59
|
+
const root = theme.mode === "dark" ? 'html[data-mode="dark"]:not([data-theme="light"])' : 'html[data-mode="light"]';
|
|
60
|
+
const subtree = theme.mode === "dark" ? '[data-mode="dark"]:not([data-theme]):not([data-theme="light"])' : '[data-mode="light"]:not([data-theme])';
|
|
61
|
+
return `${root}, ${subtree}`;
|
|
62
|
+
}
|
|
59
63
|
const modeAttr = hasMode ? `[data-mode="${theme.mode}"]` : "";
|
|
60
64
|
const attrs = `[data-theme="${theme.name}"]${modeAttr}`;
|
|
61
65
|
return `:root:root${attrs}, ${attrs}`;
|