@uniweb/theming 0.1.9 → 0.1.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/theming",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Theming utilities for the Uniweb platform — shade generation, CSS generation, theme processing",
5
5
  "type": "module",
6
6
  "exports": {
@@ -573,6 +573,14 @@ export function generateThemeCSS(config = {}, options = {}) {
573
573
  }
574
574
 
575
575
  // 6. Dark scheme support (if enabled, default is dark, or follows system preference)
576
+ //
577
+ // This guard decides whether the `.scheme-dark` rules physically exist. It is
578
+ // the CANONICAL "site reaches dark" predicate; the model-side copy that the
579
+ // runtime boot resolver and kit's useAppearance consume is hasDarkScheme() in
580
+ // @uniweb/core (theme.js). These MUST agree — a scheme applied with no
581
+ // matching CSS renders as a light page claiming to be dark. @uniweb/theming
582
+ // has no @uniweb/core dependency (it also runs server-side in the platform),
583
+ // so the predicate is duplicated here by necessity; keep the two in lockstep.
576
584
  if (appearance.allowToggle || appearance.default === 'dark' || appearance.default === 'system' || appearance.schemes?.includes('dark')) {
577
585
  sections.push(generateDarkSchemeCSS(appearance, contexts.dark, colorVars))
578
586
  }