@weasel-js/theme 1.7.3 → 1.8.0

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/README.md CHANGED
@@ -62,6 +62,13 @@ In React, `<ThemeProvider theme={acme} selection={{ mode: 'light' }}>` from
62
62
  `useTheme()` — which is how canvas and WebGL surfaces stay in sync without
63
63
  reading the DOM.
64
64
 
65
+ `--wzl-fg-muted` and `--wzl-fg-subtle` are not fixed colors: each is the text
66
+ color in effect where it is used, at a lower alpha (`rgb(from currentColor r g b
67
+ / 0.7)`), so muted text on an accent fill steps down from the on-accent text
68
+ beside it. The resolved record carries that CSS as is, because a canvas has no
69
+ `currentColor`; flatten it with `resolveCurrentColor(value, resolved['--wzl-fg'])`,
70
+ passing the color of the text it is drawn beside.
71
+
65
72
  ## The engine
66
73
 
67
74
  `@weasel-js/theme/engine` is for authoring layered theme definitions: seeds,
@@ -1,4 +1,4 @@
1
- import { themeAxes, fullSelection, selectionKey, resolveTheme, themeChain, isByAxis, generate, DEFAULT_CONSTRAINTS } from './chunk-AN5JVL2S.js';
1
+ import { themeAxes, fullSelection, selectionKey, resolveTheme, themeChain, isByAxis, generate, DEFAULT_CONSTRAINTS } from './chunk-NUILKH2Z.js';
2
2
 
3
3
  // src/generated/themes.ts
4
4
  var THEMES = {
@@ -51,8 +51,8 @@ var THEMES = {
51
51
  "--wzl-surface-raised": "#25272c",
52
52
  "--wzl-surface-sunken": "#0e0f12",
53
53
  "--wzl-fg": "#e6e7e9",
54
- "--wzl-fg-muted": "#9ea1a8",
55
- "--wzl-fg-subtle": "#6f737b",
54
+ "--wzl-fg-muted": "rgb(from currentColor r g b / 0.7)",
55
+ "--wzl-fg-subtle": "rgb(from currentColor r g b / 0.54)",
56
56
  "--wzl-border": "#25272c",
57
57
  "--wzl-border-strong": "#6f737b",
58
58
  "--wzl-accent-fg": "#8c94ee",
@@ -87,8 +87,8 @@ var THEMES = {
87
87
  "--wzl-line-subtle": "rgba(230, 231, 233, 0.1)",
88
88
  "--wzl-stance-aside-border-color": "rgba(230, 231, 233, 0.1)",
89
89
  "--wzl-stance-aside-blur": "0px",
90
- "--wzl-stance-aside-title-color": "#6f737b",
91
- "--wzl-stance-advanced-title-color": "#6f737b",
90
+ "--wzl-stance-aside-title-color": "rgb(from currentColor r g b / 0.54)",
91
+ "--wzl-stance-advanced-title-color": "rgb(from currentColor r g b / 0.54)",
92
92
  "--wzl-stance-debug-border-style": "dashed",
93
93
  "--wzl-font-mono": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
94
94
  "--wzl-stance-debug-title-font": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
@@ -220,8 +220,8 @@ var THEMES = {
220
220
  "--wzl-surface-raised": "#25272c",
221
221
  "--wzl-surface-sunken": "#0e0f12",
222
222
  "--wzl-fg": "#e6e7e9",
223
- "--wzl-fg-muted": "#9ea1a8",
224
- "--wzl-fg-subtle": "#6f737b",
223
+ "--wzl-fg-muted": "rgb(from currentColor r g b / 0.7)",
224
+ "--wzl-fg-subtle": "rgb(from currentColor r g b / 0.54)",
225
225
  "--wzl-border": "#25272c",
226
226
  "--wzl-border-strong": "#6f737b",
227
227
  "--wzl-accent-fg": "#8c94ee",
@@ -256,8 +256,8 @@ var THEMES = {
256
256
  "--wzl-line-subtle": "rgba(230, 231, 233, 0.1)",
257
257
  "--wzl-stance-aside-border-color": "rgba(230, 231, 233, 0.1)",
258
258
  "--wzl-stance-aside-blur": "0px",
259
- "--wzl-stance-aside-title-color": "#6f737b",
260
- "--wzl-stance-advanced-title-color": "#6f737b",
259
+ "--wzl-stance-aside-title-color": "rgb(from currentColor r g b / 0.54)",
260
+ "--wzl-stance-advanced-title-color": "rgb(from currentColor r g b / 0.54)",
261
261
  "--wzl-stance-debug-border-style": "dashed",
262
262
  "--wzl-font-mono": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
263
263
  "--wzl-stance-debug-title-font": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
@@ -389,8 +389,8 @@ var THEMES = {
389
389
  "--wzl-surface-raised": "#25272c",
390
390
  "--wzl-surface-sunken": "#0e0f12",
391
391
  "--wzl-fg": "#e6e7e9",
392
- "--wzl-fg-muted": "#9ea1a8",
393
- "--wzl-fg-subtle": "#6f737b",
392
+ "--wzl-fg-muted": "rgb(from currentColor r g b / 0.7)",
393
+ "--wzl-fg-subtle": "rgb(from currentColor r g b / 0.54)",
394
394
  "--wzl-border": "#25272c",
395
395
  "--wzl-border-strong": "#6f737b",
396
396
  "--wzl-accent-fg": "#8c94ee",
@@ -425,8 +425,8 @@ var THEMES = {
425
425
  "--wzl-line-subtle": "rgba(230, 231, 233, 0.1)",
426
426
  "--wzl-stance-aside-border-color": "rgba(230, 231, 233, 0.1)",
427
427
  "--wzl-stance-aside-blur": "0px",
428
- "--wzl-stance-aside-title-color": "#6f737b",
429
- "--wzl-stance-advanced-title-color": "#6f737b",
428
+ "--wzl-stance-aside-title-color": "rgb(from currentColor r g b / 0.54)",
429
+ "--wzl-stance-advanced-title-color": "rgb(from currentColor r g b / 0.54)",
430
430
  "--wzl-stance-debug-border-style": "dashed",
431
431
  "--wzl-font-mono": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
432
432
  "--wzl-stance-debug-title-font": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
@@ -558,8 +558,8 @@ var THEMES = {
558
558
  "--wzl-surface-raised": "#e6e7e9",
559
559
  "--wzl-surface-sunken": "#c9cbcf",
560
560
  "--wzl-fg": "#0e0f12",
561
- "--wzl-fg-muted": "#383b42",
562
- "--wzl-fg-subtle": "#4d5058",
561
+ "--wzl-fg-muted": "rgb(from currentColor r g b / 0.78)",
562
+ "--wzl-fg-subtle": "rgb(from currentColor r g b / 0.64)",
563
563
  "--wzl-border": "#c9cbcf",
564
564
  "--wzl-border-strong": "#4d5058",
565
565
  "--wzl-accent-fg": "#4338ca",
@@ -594,8 +594,8 @@ var THEMES = {
594
594
  "--wzl-line-subtle": "rgba(14, 15, 18, 0.1)",
595
595
  "--wzl-stance-aside-border-color": "rgba(14, 15, 18, 0.1)",
596
596
  "--wzl-stance-aside-blur": "0px",
597
- "--wzl-stance-aside-title-color": "#4d5058",
598
- "--wzl-stance-advanced-title-color": "#4d5058",
597
+ "--wzl-stance-aside-title-color": "rgb(from currentColor r g b / 0.64)",
598
+ "--wzl-stance-advanced-title-color": "rgb(from currentColor r g b / 0.64)",
599
599
  "--wzl-stance-debug-border-style": "dashed",
600
600
  "--wzl-font-mono": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
601
601
  "--wzl-stance-debug-title-font": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
@@ -727,8 +727,8 @@ var THEMES = {
727
727
  "--wzl-surface-raised": "#e6e7e9",
728
728
  "--wzl-surface-sunken": "#c9cbcf",
729
729
  "--wzl-fg": "#0e0f12",
730
- "--wzl-fg-muted": "#383b42",
731
- "--wzl-fg-subtle": "#4d5058",
730
+ "--wzl-fg-muted": "rgb(from currentColor r g b / 0.78)",
731
+ "--wzl-fg-subtle": "rgb(from currentColor r g b / 0.64)",
732
732
  "--wzl-border": "#c9cbcf",
733
733
  "--wzl-border-strong": "#4d5058",
734
734
  "--wzl-accent-fg": "#4338ca",
@@ -763,8 +763,8 @@ var THEMES = {
763
763
  "--wzl-line-subtle": "rgba(14, 15, 18, 0.1)",
764
764
  "--wzl-stance-aside-border-color": "rgba(14, 15, 18, 0.1)",
765
765
  "--wzl-stance-aside-blur": "0px",
766
- "--wzl-stance-aside-title-color": "#4d5058",
767
- "--wzl-stance-advanced-title-color": "#4d5058",
766
+ "--wzl-stance-aside-title-color": "rgb(from currentColor r g b / 0.64)",
767
+ "--wzl-stance-advanced-title-color": "rgb(from currentColor r g b / 0.64)",
768
768
  "--wzl-stance-debug-border-style": "dashed",
769
769
  "--wzl-font-mono": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
770
770
  "--wzl-stance-debug-title-font": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
@@ -896,8 +896,8 @@ var THEMES = {
896
896
  "--wzl-surface-raised": "#e6e7e9",
897
897
  "--wzl-surface-sunken": "#c9cbcf",
898
898
  "--wzl-fg": "#0e0f12",
899
- "--wzl-fg-muted": "#383b42",
900
- "--wzl-fg-subtle": "#4d5058",
899
+ "--wzl-fg-muted": "rgb(from currentColor r g b / 0.78)",
900
+ "--wzl-fg-subtle": "rgb(from currentColor r g b / 0.64)",
901
901
  "--wzl-border": "#c9cbcf",
902
902
  "--wzl-border-strong": "#4d5058",
903
903
  "--wzl-accent-fg": "#4338ca",
@@ -932,8 +932,8 @@ var THEMES = {
932
932
  "--wzl-line-subtle": "rgba(14, 15, 18, 0.1)",
933
933
  "--wzl-stance-aside-border-color": "rgba(14, 15, 18, 0.1)",
934
934
  "--wzl-stance-aside-blur": "0px",
935
- "--wzl-stance-aside-title-color": "#4d5058",
936
- "--wzl-stance-advanced-title-color": "#4d5058",
935
+ "--wzl-stance-aside-title-color": "rgb(from currentColor r g b / 0.64)",
936
+ "--wzl-stance-advanced-title-color": "rgb(from currentColor r g b / 0.64)",
937
937
  "--wzl-stance-debug-border-style": "dashed",
938
938
  "--wzl-font-mono": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
939
939
  "--wzl-stance-debug-title-font": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
@@ -1247,23 +1247,27 @@ var THEME_SOURCES = {
1247
1247
  "fg-muted": {
1248
1248
  "by": "mode",
1249
1249
  "dark": {
1250
- "ref": "gray-300",
1251
- "type": "color"
1250
+ "value": "rgb(from currentColor r g b / 0.7)",
1251
+ "type": "color",
1252
+ "description": "Secondary text: the text color in effect where it is used, at reduced alpha, so it steps down from whatever text it sits beside on any surface. The alpha is absolute, so muted text nested in muted text stays one step down. Under fg it clears WCAG 4.5:1 on surface, surface-raised, and surface-sunken in both modes."
1252
1253
  },
1253
1254
  "light": {
1254
- "ref": "gray-600",
1255
- "type": "color"
1255
+ "value": "rgb(from currentColor r g b / 0.78)",
1256
+ "type": "color",
1257
+ "description": "Secondary text: the text color in effect where it is used, at reduced alpha, so it steps down from whatever text it sits beside on any surface. The alpha is absolute, so muted text nested in muted text stays one step down. Under fg it clears WCAG 4.5:1 on surface, surface-raised, and surface-sunken in both modes."
1256
1258
  }
1257
1259
  },
1258
1260
  "fg-subtle": {
1259
1261
  "by": "mode",
1260
1262
  "dark": {
1261
- "ref": "gray-400",
1262
- "type": "color"
1263
+ "value": "rgb(from currentColor r g b / 0.54)",
1264
+ "type": "color",
1265
+ "description": "Tertiary text: a further step down from the text color in effect, by the same rule as fg-muted. Under fg it clears WCAG 4.5:1 on surface, surface-raised, and surface-sunken in both modes."
1263
1266
  },
1264
1267
  "light": {
1265
- "ref": "gray-500",
1266
- "type": "color"
1268
+ "value": "rgb(from currentColor r g b / 0.64)",
1269
+ "type": "color",
1270
+ "description": "Tertiary text: a further step down from the text color in effect, by the same rule as fg-muted. Under fg it clears WCAG 4.5:1 on surface, surface-raised, and surface-sunken in both modes."
1267
1271
  }
1268
1272
  },
1269
1273
  "border": {
@@ -2451,22 +2455,26 @@ var BAKED_THEMES = {
2451
2455
  "by": "mode",
2452
2456
  "dark": {
2453
2457
  "type": "color",
2454
- "value": "{gray-300}"
2458
+ "value": "rgb(from currentColor r g b / 0.7)",
2459
+ "description": "Secondary text: the text color in effect where it is used, at reduced alpha, so it steps down from whatever text it sits beside on any surface. The alpha is absolute, so muted text nested in muted text stays one step down. Under fg it clears WCAG 4.5:1 on surface, surface-raised, and surface-sunken in both modes."
2455
2460
  },
2456
2461
  "light": {
2457
2462
  "type": "color",
2458
- "value": "{gray-600}"
2463
+ "value": "rgb(from currentColor r g b / 0.78)",
2464
+ "description": "Secondary text: the text color in effect where it is used, at reduced alpha, so it steps down from whatever text it sits beside on any surface. The alpha is absolute, so muted text nested in muted text stays one step down. Under fg it clears WCAG 4.5:1 on surface, surface-raised, and surface-sunken in both modes."
2459
2465
  }
2460
2466
  },
2461
2467
  "fg-subtle": {
2462
2468
  "by": "mode",
2463
2469
  "dark": {
2464
2470
  "type": "color",
2465
- "value": "{gray-400}"
2471
+ "value": "rgb(from currentColor r g b / 0.54)",
2472
+ "description": "Tertiary text: a further step down from the text color in effect, by the same rule as fg-muted. Under fg it clears WCAG 4.5:1 on surface, surface-raised, and surface-sunken in both modes."
2466
2473
  },
2467
2474
  "light": {
2468
2475
  "type": "color",
2469
- "value": "{gray-500}"
2476
+ "value": "rgb(from currentColor r g b / 0.64)",
2477
+ "description": "Tertiary text: a further step down from the text color in effect, by the same rule as fg-muted. Under fg it clears WCAG 4.5:1 on surface, surface-raised, and surface-sunken in both modes."
2470
2478
  }
2471
2479
  },
2472
2480
  "border": {
@@ -3347,5 +3355,5 @@ function colorCount(list, ctx = defaultContext()) {
3347
3355
  }
3348
3356
 
3349
3357
  export { BAKED_THEMES, THEMES, THEME_SOURCES, applyTheme, colorAt, colorCount, colorCssAt, defineTheme, isColorModePreference, rampSteps, themeTones, weaselTheme };
3350
- //# sourceMappingURL=chunk-HO2AM2OB.js.map
3351
- //# sourceMappingURL=chunk-HO2AM2OB.js.map
3358
+ //# sourceMappingURL=chunk-BOC4EQ5K.js.map
3359
+ //# sourceMappingURL=chunk-BOC4EQ5K.js.map