@loworbitstudio/visor-theme-engine 0.31.0 → 0.31.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.
@@ -29,7 +29,7 @@ import {
29
29
  resolveThemeBrand,
30
30
  resolveThemeFonts,
31
31
  sectionComment
32
- } from "../chunk-NJLYCTHR.js";
32
+ } from "../chunk-Y4XRYCNV.js";
33
33
 
34
34
  // src/adapters/brand-passthrough.ts
35
35
  var SENTINEL_COLOR = "#ff00ff";
@@ -692,6 +692,7 @@ function sectionComment2(label) {
692
692
  function docsAdapter(input, options) {
693
693
  const slug = toKebabCase3(input.config.name);
694
694
  const scopeClass = `.${slug}-theme`;
695
+ const prefersSel = `html:not(.light) ${scopeClass}:not(.light):not(.theme-light):not([data-theme="light"])`;
695
696
  const colorScheme = input.config["color-scheme"] ?? "adaptive";
696
697
  const singleMode = colorScheme === "dark-only" ? "dark" : colorScheme === "light-only" ? "light" : null;
697
698
  const emitDark = colorScheme !== "light-only";
@@ -826,7 +827,7 @@ function docsAdapter(input, options) {
826
827
  if (emitPrefers) {
827
828
  for (const cat of pcsCategories) {
828
829
  lines.push(sectionComment2(`Adaptive: ${cat.label} (dark) \u2014 prefers-color-scheme`));
829
- const inner = block2(`${scopeClass}:not(.light):not(.theme-light):not([data-theme="light"])`, cat.entries);
830
+ const inner = block2(prefersSel, cat.entries);
830
831
  lines.push(`@media (prefers-color-scheme: dark) {
831
832
  ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
832
833
  }`);
@@ -835,7 +836,7 @@ ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
835
836
  }
836
837
  if (darkPrimitiveOverrides.length > 0 && emitPrefers) {
837
838
  lines.push(sectionComment2("Primitive overrides (dark) \u2014 prefers-color-scheme"));
838
- const inner = block2(`${scopeClass}:not(.light):not(.theme-light):not([data-theme="light"])`, darkPrimitiveOverrides);
839
+ const inner = block2(prefersSel, darkPrimitiveOverrides);
839
840
  lines.push(`@media (prefers-color-scheme: dark) {
840
841
  ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
841
842
  }`);
@@ -892,7 +893,7 @@ ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
892
893
  if (emitPrefers) {
893
894
  semanticLines.push(sectionComment2("Intent aliases (dark) \u2014 prefers-color-scheme"));
894
895
  {
895
- const inner = block2(`${scopeClass}:not(.light):not(.theme-light):not([data-theme="light"])`, generateIntentDecls(input.tokens, "dark"));
896
+ const inner = block2(prefersSel, generateIntentDecls(input.tokens, "dark"));
896
897
  semanticLines.push(`@media (prefers-color-scheme: dark) {
897
898
  ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
898
899
  }`);
@@ -900,7 +901,7 @@ ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
900
901
  semanticLines.push("");
901
902
  semanticLines.push(sectionComment2("Hairline aliases (dark) \u2014 prefers-color-scheme"));
902
903
  {
903
- const inner = block2(`${scopeClass}:not(.light):not(.theme-light):not([data-theme="light"])`, generateHairlineDecls(input.tokens, "dark"));
904
+ const inner = block2(prefersSel, generateHairlineDecls(input.tokens, "dark"));
904
905
  semanticLines.push(`@media (prefers-color-scheme: dark) {
905
906
  ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
906
907
  }`);
@@ -913,7 +914,7 @@ ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
913
914
  {
914
915
  light: lightSel,
915
916
  dark: darkSel,
916
- prefers: `${scopeClass}:not(.light):not(.theme-light):not([data-theme="light"])`
917
+ prefers: prefersSel
917
918
  },
918
919
  colorScheme
919
920
  );
@@ -922,7 +923,7 @@ ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
922
923
  {
923
924
  light: lightSel,
924
925
  dark: darkSel,
925
- prefers: `${scopeClass}:not(.light):not(.theme-light):not([data-theme="light"])`
926
+ prefers: prefersSel
926
927
  },
927
928
  colorScheme
928
929
  );
@@ -946,7 +947,7 @@ ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
946
947
  semanticLines.push(block2(darkSel, darkAliasDecls));
947
948
  semanticLines.push("");
948
949
  semanticLines.push(sectionComment2("visor-core alias re-substitution (dark) \u2014 prefers-color-scheme (VI-696)"));
949
- const inner = block2(`${scopeClass}:not(.light):not(.theme-light):not([data-theme="light"])`, darkAliasDecls);
950
+ const inner = block2(prefersSel, darkAliasDecls);
950
951
  semanticLines.push(`@media (prefers-color-scheme: dark) {
951
952
  ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
952
953
  }`);
@@ -834,7 +834,7 @@ function generateBrandCSS(resolutions, scope, colorScheme = "adaptive") {
834
834
  const baseSelector = scope ? scope : ":root";
835
835
  const lightSelector = scope ? `html:not(.dark) ${scope}` : ":root";
836
836
  const darkSelector = scope ? `.dark ${scope}` : ".dark";
837
- const pcsSelector = scope ? `${scope}:not(.light)` : ":root:not(.light)";
837
+ const pcsSelector = scope ? `html:not(.light) ${scope}:not(.light)` : ":root:not(.light)";
838
838
  const lines = [];
839
839
  const staticDecls = resolutions.flatMap(staticDeclsFor);
840
840
  lines.push("/* --- Brand: forced-mode aliases + tokens --- */");
package/dist/index.js CHANGED
@@ -68,7 +68,7 @@ import {
68
68
  rgbToOklch,
69
69
  serializeColor,
70
70
  validateComponentBindings
71
- } from "./chunk-NJLYCTHR.js";
71
+ } from "./chunk-Y4XRYCNV.js";
72
72
 
73
73
  // src/fonts/validate-coverage.ts
74
74
  var FONT_VAR_RE = /--font-(heading|display|body|sans|mono)\s*:\s*([^;]+);/g;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loworbitstudio/visor-theme-engine",
3
- "version": "0.31.0",
3
+ "version": "0.31.1",
4
4
  "description": "Theme engine for the Visor design system — shade generation, token mapping, font resolution, and import/export for .visor.yaml themes.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",