@weasel-js/theme 1.5.0 → 1.5.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/README.md +67 -14
- package/dist/chunk-LL2ERJPZ.js +175 -0
- package/dist/chunk-LL2ERJPZ.js.map +1 -0
- package/dist/chunk-PJMTWM34.js +6 -0
- package/dist/chunk-PJMTWM34.js.map +1 -0
- package/dist/chunk-XFCWYN2L.js +2401 -0
- package/dist/chunk-XFCWYN2L.js.map +1 -0
- package/dist/engine.d.ts +293 -0
- package/dist/engine.js +1789 -0
- package/dist/engine.js.map +1 -0
- package/dist/index.d.ts +49 -15
- package/dist/index.js +156 -116
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +7 -5
- package/dist/react.js +13 -18
- package/dist/react.js.map +1 -1
- package/dist/resolveTheme-CF8i5IHy.d.ts +766 -0
- package/dist/theme-DAZcQi_L.d.ts +191 -0
- package/dist/tokens.css +116 -42
- package/package.json +8 -1
- package/dist/chunk-VKZ4JIVX.js +0 -912
- package/dist/chunk-VKZ4JIVX.js.map +0 -1
- package/dist/resolveTheme-DiF2Ew25.d.ts +0 -296
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/** One value of an axis. `scheme` becomes `color-scheme` in that value's CSS blocks. */
|
|
2
|
+
interface AxisValue {
|
|
3
|
+
readonly scheme?: 'dark' | 'light';
|
|
4
|
+
}
|
|
5
|
+
interface AxisDef {
|
|
6
|
+
readonly default: string;
|
|
7
|
+
readonly values: Readonly<Record<string, AxisValue>>;
|
|
8
|
+
}
|
|
9
|
+
/** Key order is declaration order, which selectors and selection keys follow. */
|
|
10
|
+
type AxisDefs = Readonly<Record<string, AxisDef>>;
|
|
11
|
+
/** A partial choice of axis values, e.g. `{ mode: 'light' }`. */
|
|
12
|
+
type Selection = Readonly<Record<string, string>>;
|
|
13
|
+
/** `{ by: 'mode', dark: …, light: … }`: a value that differs per axis value. */
|
|
14
|
+
interface ByAxis<T> {
|
|
15
|
+
readonly by: string;
|
|
16
|
+
readonly [axisValue: string]: Varying<T> | string;
|
|
17
|
+
}
|
|
18
|
+
type Varying<T> = T | ByAxis<T>;
|
|
19
|
+
declare function isByAxis(v: unknown): v is ByAxis<unknown>;
|
|
20
|
+
/** Every axis given a known value; anything missing or unknown takes its default. */
|
|
21
|
+
declare function fullSelection(axes: AxisDefs, selection?: Selection): Selection;
|
|
22
|
+
declare function enumerateSelections(axes: AxisDefs): Selection[];
|
|
23
|
+
/** `mode=dark,density=compact`, axes in declaration order. */
|
|
24
|
+
declare function selectionKey(axes: AxisDefs, selection: Selection): string;
|
|
25
|
+
|
|
26
|
+
type TokenValue = string | number | readonly (string | number)[];
|
|
27
|
+
/**
|
|
28
|
+
* A single design token as authored, before aliases are resolved: a DTCG-shaped
|
|
29
|
+
* `{ type, value }` pair where `value` may still be a `{ref}` to another token.
|
|
30
|
+
*/
|
|
31
|
+
interface RawToken {
|
|
32
|
+
readonly type: string;
|
|
33
|
+
readonly value: TokenValue;
|
|
34
|
+
/** Render the referenced color at this alpha, 0–1. */
|
|
35
|
+
readonly alpha?: number | undefined;
|
|
36
|
+
readonly description?: string | undefined;
|
|
37
|
+
}
|
|
38
|
+
/** A token graph flattened to one level, keyed by token name (no `--wzl-`
|
|
39
|
+
* prefix). Still unresolved — see `ResolvedTokenMap` for the output side. */
|
|
40
|
+
type FlatTokens = Record<string, RawToken>;
|
|
41
|
+
|
|
42
|
+
/** A number, or `{seeds.name}`. */
|
|
43
|
+
type NumberParam = Varying<number | string>;
|
|
44
|
+
interface PinObject {
|
|
45
|
+
readonly value: TokenValue;
|
|
46
|
+
readonly type?: string;
|
|
47
|
+
readonly description?: string;
|
|
48
|
+
readonly alpha?: number;
|
|
49
|
+
}
|
|
50
|
+
/** A bare value or `{ value, type?, description?, alpha? }`. The value may be a `{token}` reference. */
|
|
51
|
+
type PinValue = TokenValue | PinObject;
|
|
52
|
+
interface LightnessRampDef {
|
|
53
|
+
readonly kind: 'lightness';
|
|
54
|
+
readonly steps: Varying<readonly string[]>;
|
|
55
|
+
/** First and last step's OKLCH lightness. */
|
|
56
|
+
readonly lightness: Varying<readonly [NumberParam, NumberParam]>;
|
|
57
|
+
/** 0 walks evenly; 1 follows a smoothstep S. */
|
|
58
|
+
readonly curve?: NumberParam;
|
|
59
|
+
/** Degrees. Ignored when an anchor is given. */
|
|
60
|
+
readonly hue?: NumberParam;
|
|
61
|
+
readonly chroma?: Varying<{
|
|
62
|
+
readonly peak: NumberParam;
|
|
63
|
+
readonly lightBias?: NumberParam;
|
|
64
|
+
readonly darkBias?: NumberParam;
|
|
65
|
+
}>;
|
|
66
|
+
/** Step name → exact hex (or `{seeds.name}`). The first anchor supplies hue and chroma. */
|
|
67
|
+
readonly anchor?: Varying<Readonly<Record<string, Varying<string>>>>;
|
|
68
|
+
readonly description?: string;
|
|
69
|
+
readonly describe?: Readonly<Record<string, string>>;
|
|
70
|
+
}
|
|
71
|
+
interface CategoricalRampDef {
|
|
72
|
+
readonly kind: 'categorical';
|
|
73
|
+
readonly steps: Varying<readonly string[]>;
|
|
74
|
+
/** Any of the palette generator's `Constraints` except `count` and `anchors`. */
|
|
75
|
+
readonly gates?: Varying<Readonly<Record<string, Varying<number | string>>>>;
|
|
76
|
+
readonly anchors?: readonly {
|
|
77
|
+
readonly name: string;
|
|
78
|
+
readonly hue: number;
|
|
79
|
+
readonly lightness: number;
|
|
80
|
+
readonly chroma?: number;
|
|
81
|
+
}[];
|
|
82
|
+
readonly description?: string;
|
|
83
|
+
readonly describe?: Readonly<Record<string, string>>;
|
|
84
|
+
}
|
|
85
|
+
type RampDef = LightnessRampDef | CategoricalRampDef;
|
|
86
|
+
interface ScaleDef {
|
|
87
|
+
readonly steps: Varying<readonly string[]>;
|
|
88
|
+
readonly base: NumberParam;
|
|
89
|
+
/** Linear: `base + step × i`. */
|
|
90
|
+
readonly step?: NumberParam;
|
|
91
|
+
/** Geometric: `base × ratio^i`. */
|
|
92
|
+
readonly ratio?: NumberParam;
|
|
93
|
+
/** Explicit: `base × factors[i]`, one per step. For a ramp no single rule fits. */
|
|
94
|
+
readonly factors?: Varying<readonly NumberParam[]>;
|
|
95
|
+
readonly description?: string;
|
|
96
|
+
readonly describe?: Readonly<Record<string, string>>;
|
|
97
|
+
}
|
|
98
|
+
interface SemanticCommon {
|
|
99
|
+
readonly type?: string;
|
|
100
|
+
readonly description?: string;
|
|
101
|
+
/** Audited, never applied. */
|
|
102
|
+
readonly check?: {
|
|
103
|
+
readonly contrast: number;
|
|
104
|
+
readonly against: readonly string[];
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
type StepRule = SemanticCommon & {
|
|
108
|
+
readonly ramp: string;
|
|
109
|
+
readonly step: Varying<string>;
|
|
110
|
+
};
|
|
111
|
+
type OffsetRule = SemanticCommon & {
|
|
112
|
+
readonly from: string;
|
|
113
|
+
readonly offset: number;
|
|
114
|
+
readonly dir: 'lighter' | 'darker' | 'away';
|
|
115
|
+
};
|
|
116
|
+
type ContrastRule = SemanticCommon & {
|
|
117
|
+
readonly ramp: string;
|
|
118
|
+
readonly contrast: {
|
|
119
|
+
readonly min: number;
|
|
120
|
+
readonly against: readonly string[];
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
type RefRule = SemanticCommon & {
|
|
124
|
+
readonly ref: string;
|
|
125
|
+
readonly alpha?: number;
|
|
126
|
+
};
|
|
127
|
+
type LiteralRule = SemanticCommon & {
|
|
128
|
+
readonly value: TokenValue;
|
|
129
|
+
};
|
|
130
|
+
type SemanticRule = StepRule | OffsetRule | ContrastRule | RefRule | LiteralRule;
|
|
131
|
+
interface ThemeDefinition {
|
|
132
|
+
readonly name: string;
|
|
133
|
+
/** Another definition's name. Absent or null: extends nothing. */
|
|
134
|
+
readonly extends?: string | null;
|
|
135
|
+
readonly description?: string;
|
|
136
|
+
readonly axes?: AxisDefs;
|
|
137
|
+
readonly seeds?: Readonly<Record<string, Varying<number | string>>>;
|
|
138
|
+
readonly ramps?: Readonly<Record<string, RampDef>>;
|
|
139
|
+
readonly scales?: Readonly<Record<string, ScaleDef>>;
|
|
140
|
+
readonly semantics?: Readonly<Record<string, Varying<SemanticRule>>>;
|
|
141
|
+
readonly components?: Readonly<Record<string, Varying<PinValue>>>;
|
|
142
|
+
readonly pins?: Readonly<Record<string, Varying<PinValue>>>;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
type Lookup = (name: string) => ThemeDefinition | undefined;
|
|
146
|
+
/** The definition with its whole `extends` chain folded in, child entries winning. */
|
|
147
|
+
declare function mergeChain(def: ThemeDefinition, lookup?: Lookup, seen?: ReadonlySet<string>): ThemeDefinition;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* A definition with every rule run: plain or `by`-varying tokens, references intact.
|
|
151
|
+
* A branch `derive` could not produce is left out, so at runtime it falls through to the parent; definitions with
|
|
152
|
+
* issues still bake, because the editor bakes mid-edit and the build refuses them before baking. Cycles and dangling
|
|
153
|
+
* references still throw, as they do in `derive`.
|
|
154
|
+
*/
|
|
155
|
+
interface BakedTheme {
|
|
156
|
+
readonly name: string;
|
|
157
|
+
readonly extends: string | null;
|
|
158
|
+
readonly axes: AxisDefs;
|
|
159
|
+
/** In layer order, then definition order. */
|
|
160
|
+
readonly tokens: Readonly<Record<string, Varying<RawToken>>>;
|
|
161
|
+
}
|
|
162
|
+
/** Derive `definition` at every selection and fold the results into one record of tokens with no rules left. */
|
|
163
|
+
declare function bake(definition: ThemeDefinition, lookup?: Lookup): BakedTheme;
|
|
164
|
+
/** `definition` and every theme it extends, baked, root first. */
|
|
165
|
+
declare function bakeChain(definition: ThemeDefinition, lookup?: Lookup): BakedTheme[];
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* A theme ready to resolve: its axes and its tokens, each plain or varying by
|
|
169
|
+
* axis, references intact. A `by` that leaves a value out contributes nothing
|
|
170
|
+
* for that selection, so the theme it extends supplies it.
|
|
171
|
+
*/
|
|
172
|
+
interface Theme {
|
|
173
|
+
readonly name: string;
|
|
174
|
+
readonly extends: Theme | null;
|
|
175
|
+
readonly axes: AxisDefs;
|
|
176
|
+
readonly tokens: Readonly<Record<string, Varying<RawToken>>>;
|
|
177
|
+
}
|
|
178
|
+
/** What `defineTheme` accepts: a definition whose `extends` is a `Theme`, holding pins and components only. */
|
|
179
|
+
type ThemeInput = Omit<ThemeDefinition, 'extends'> & {
|
|
180
|
+
readonly extends?: Theme | null;
|
|
181
|
+
};
|
|
182
|
+
/** The built-in theme, from the baked output of themes/weasel.json. */
|
|
183
|
+
declare const weaselTheme: Theme;
|
|
184
|
+
/**
|
|
185
|
+
* Build a theme from pins. Unless `extends` says otherwise the result layers
|
|
186
|
+
* onto `weaselTheme`, so a theme only names what it changes. A definition with
|
|
187
|
+
* seeds, ramps, scales or semantics needs deriving first.
|
|
188
|
+
*/
|
|
189
|
+
declare function defineTheme(input: ThemeInput): Theme;
|
|
190
|
+
|
|
191
|
+
export { type AxisDef as A, type BakedTheme as B, type CategoricalRampDef as C, type FlatTokens as F, type Lookup as L, type NumberParam as N, type OffsetRule as O, type PinObject as P, type RawToken as R, type Selection as S, type Theme as T, type Varying as V, type TokenValue as a, type AxisDefs as b, type AxisValue as c, type ByAxis as d, type PinValue as e, type ThemeDefinition as f, type ThemeInput as g, defineTheme as h, enumerateSelections as i, fullSelection as j, isByAxis as k, type ContrastRule as l, type LightnessRampDef as m, type LiteralRule as n, type RampDef as o, type RefRule as p, type ScaleDef as q, type SemanticRule as r, selectionKey as s, type StepRule as t, bake as u, bakeChain as v, weaselTheme as w, mergeChain as x };
|
package/dist/tokens.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* GENERATED by packages/theme/scripts/build-tokens.ts — do not edit.
|
|
2
|
-
* Source: packages/theme/
|
|
2
|
+
* Source: packages/theme/themes/<theme>.json
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
:root {
|
|
@@ -18,6 +18,52 @@
|
|
|
18
18
|
/* Midnight blue-violet. Deep and saturated; anchors primary actions on light and dark surfaces alike. */
|
|
19
19
|
--wzl-accent-base: #2e1f7a;
|
|
20
20
|
--wzl-accent-strong: #5841b8;
|
|
21
|
+
/* First of ten categorical spot colors for plotting, status and data viz. Take them in sequence: the order is farthest-point over hue, so the first N are as separated as N colors can be (first three 87° apart, all ten 32°). Mode-invariant on purpose — a series keeps its color when the mode flips, which is why they are tuned for a dark surface and clear only 1.5:1 on a light one. */
|
|
22
|
+
--wzl-swatch-fuchsia: #f641f7;
|
|
23
|
+
--wzl-swatch-green: #48e628;
|
|
24
|
+
--wzl-swatch-sky: #36bff2;
|
|
25
|
+
--wzl-swatch-amber: #e69628;
|
|
26
|
+
--wzl-swatch-teal: #3ee1cb;
|
|
27
|
+
--wzl-swatch-red: #f75034;
|
|
28
|
+
--wzl-swatch-blue: #407ef7;
|
|
29
|
+
--wzl-swatch-citron: #d5d23a;
|
|
30
|
+
--wzl-swatch-rose: #fa4590;
|
|
31
|
+
--wzl-swatch-violet: #955cf9;
|
|
32
|
+
/* Shortcut keys and index badges. The floor for chrome text. */
|
|
33
|
+
--wzl-font-size-2xs: 9px;
|
|
34
|
+
/* Tool-button labels under an icon. */
|
|
35
|
+
--wzl-font-size-xs: 10px;
|
|
36
|
+
/* Chrome labels, status readouts, section headings. */
|
|
37
|
+
--wzl-font-size-sm: 11px;
|
|
38
|
+
/* Controls and body text. */
|
|
39
|
+
--wzl-font-size-md: 13px;
|
|
40
|
+
/* Panel and dialog titles. */
|
|
41
|
+
--wzl-font-size-lg: 16px;
|
|
42
|
+
/* The largest chrome text — a lab or app title. */
|
|
43
|
+
--wzl-font-size-xl: 20px;
|
|
44
|
+
--wzl-space-1: 2px;
|
|
45
|
+
--wzl-space-2: 4px;
|
|
46
|
+
--wzl-space-3: 6px;
|
|
47
|
+
--wzl-space-4: 8px;
|
|
48
|
+
--wzl-space-5: 10px;
|
|
49
|
+
--wzl-space-6: 12px;
|
|
50
|
+
--wzl-space-7: 14px;
|
|
51
|
+
--wzl-space-8: 16px;
|
|
52
|
+
--wzl-surface: var(--wzl-gray-800);
|
|
53
|
+
--wzl-surface-raised: var(--wzl-gray-700);
|
|
54
|
+
--wzl-surface-sunken: var(--wzl-gray-900);
|
|
55
|
+
--wzl-fg: var(--wzl-gray-100);
|
|
56
|
+
--wzl-fg-muted: var(--wzl-gray-300);
|
|
57
|
+
--wzl-fg-subtle: var(--wzl-gray-400);
|
|
58
|
+
--wzl-border: var(--wzl-gray-700);
|
|
59
|
+
/* The line that has to be seen: a control's edge, a raised surface's outline. Clears WCAG 1.4.11's 3:1 against every surface in both modes. */
|
|
60
|
+
--wzl-border-strong: var(--wzl-gray-400);
|
|
61
|
+
/* Accent for foreground use — text, icons, selected labels drawn on a surface. accent is a fill; the midnight base is too dim to read as text on dark surfaces. */
|
|
62
|
+
--wzl-accent-fg: var(--wzl-accent-strong);
|
|
63
|
+
/* Text drawn on a filled foreground-colored element (e.g. a slider thumb). Flips with the mode, so it is a semantic, not an alias to a primitive. */
|
|
64
|
+
--wzl-fg-inverse: var(--wzl-gray-900);
|
|
65
|
+
/* Elevation. Always darker than any surface — never derived from fg, which is near-white on dark. */
|
|
66
|
+
--wzl-shadow: rgba(0, 0, 0, 0.6);
|
|
21
67
|
--wzl-danger-base: #d94a3f;
|
|
22
68
|
--wzl-warning-base: #d99a3f;
|
|
23
69
|
--wzl-success-base: #2ec27e;
|
|
@@ -42,17 +88,6 @@
|
|
|
42
88
|
--wzl-surface-hover: color-mix(in srgb, var(--wzl-fg) 10%, transparent);
|
|
43
89
|
/* Pressed wash over a raised surface. */
|
|
44
90
|
--wzl-surface-pressed: color-mix(in srgb, var(--wzl-fg) 18%, transparent);
|
|
45
|
-
/* First of ten categorical spot colors for plotting, status and data viz. Take them in sequence: the order is farthest-point over hue, so the first N are as separated as N colors can be (first three 87° apart, all ten 32°). Mode-invariant on purpose — a series keeps its color when the mode flips, which is why they are tuned for a dark surface and clear only 1.5:1 on a light one. */
|
|
46
|
-
--wzl-swatch-fuchsia: #f641f7;
|
|
47
|
-
--wzl-swatch-green: #48e628;
|
|
48
|
-
--wzl-swatch-sky: #36bff2;
|
|
49
|
-
--wzl-swatch-amber: #e69628;
|
|
50
|
-
--wzl-swatch-teal: #3ee1cb;
|
|
51
|
-
--wzl-swatch-red: #f75034;
|
|
52
|
-
--wzl-swatch-blue: #407ef7;
|
|
53
|
-
--wzl-swatch-citron: #d5d23a;
|
|
54
|
-
--wzl-swatch-rose: #fa4590;
|
|
55
|
-
--wzl-swatch-violet: #955cf9;
|
|
56
91
|
--wzl-radius-sm: 3px;
|
|
57
92
|
--wzl-radius-md: 5px;
|
|
58
93
|
--wzl-radius-lg: 14px;
|
|
@@ -65,8 +100,14 @@
|
|
|
65
100
|
--wzl-curve-width: 3px;
|
|
66
101
|
/* Height of a horizontal toolbar strip (ActionsBar, OptionsBar, ToolOptionsBar). Taller than control-h so the controls inside a strip are not flush with its edges. */
|
|
67
102
|
--wzl-tb-height: 28px;
|
|
103
|
+
/* Height of the smallest interactive control -- a stepper, a keycap, a swatch button in a dense row. The rank below control-h-sm. */
|
|
104
|
+
--wzl-control-h-xs: 18px;
|
|
105
|
+
/* Height of a control in a dense inspector -- a Properties field, a small Button. The rank below control-h, which sizes a standalone control. */
|
|
106
|
+
--wzl-control-h-sm: 20px;
|
|
68
107
|
/* Height of an interactive control — button, input, select, segmented control. Distinct from tb-height, which sizes the strip a row of them sits in. */
|
|
69
108
|
--wzl-control-h: 24px;
|
|
109
|
+
/* Side of a square icon button -- a dialog close, a row remove, a field clear. Smaller than control-h because it carries a glyph rather than a label, and square, so it sizes both axes. */
|
|
110
|
+
--wzl-icon-button-size: 22px;
|
|
70
111
|
/* Height of a linear range track. The kit's single-thumb ranges all wear this; Slider's default 24px canvas track does not. */
|
|
71
112
|
--wzl-slider-track-h: 4px;
|
|
72
113
|
/* Diameter of a linear range thumb. */
|
|
@@ -75,26 +116,18 @@
|
|
|
75
116
|
--wzl-slider-track-mix: 18%;
|
|
76
117
|
/* Accent proportion in a range thumb, as a color-mix percentage — not a color. */
|
|
77
118
|
--wzl-slider-thumb-mix: 70%;
|
|
119
|
+
/* Edge of a draggable handle on a plot or timeline — a keyframe diamond, a timeline key, an event mark. The default rank; -sm and -lg are the two deliberate departures from it. */
|
|
120
|
+
--wzl-handle-size: 9px;
|
|
121
|
+
/* A handle that is drawn but not draggable — a locked or pinned point. Smaller so it reads as inert next to a live one. */
|
|
122
|
+
--wzl-handle-size-sm: 7px;
|
|
123
|
+
/* A handle that is a category of its own rather than one of a row — a curve's endpoint. Larger so it separates from the handles it sits in line with. */
|
|
124
|
+
--wzl-handle-size-lg: 10px;
|
|
78
125
|
/* Horizontal padding inside a boxed field. Pairs with --wzl-field-h, which is a container override and has no :root default. */
|
|
79
126
|
--wzl-field-pad-x: 8px;
|
|
80
127
|
/* Backdrop blur radius for frosted surfaces. Pairs with glass-tint. */
|
|
81
128
|
--wzl-glass-blur: 3px;
|
|
82
|
-
/* Shortcut keys and index badges. The floor for chrome text. */
|
|
83
|
-
--wzl-font-size-2xs: 9px;
|
|
84
|
-
/* Tool-button labels under an icon. */
|
|
85
|
-
--wzl-font-size-xs: 10px;
|
|
86
|
-
/* Chrome labels, status readouts, section headings. */
|
|
87
|
-
--wzl-font-size-sm: 11px;
|
|
88
129
|
/* Controls and body text. */
|
|
89
|
-
--wzl-font-size:
|
|
90
|
-
/* Panel and dialog titles. */
|
|
91
|
-
--wzl-font-size-lg: 16px;
|
|
92
|
-
/* The largest chrome text — a lab or app title. */
|
|
93
|
-
--wzl-font-size-xl: 20px;
|
|
94
|
-
--wzl-space-xs: 4px;
|
|
95
|
-
--wzl-space-sm: 8px;
|
|
96
|
-
--wzl-space-md: 12px;
|
|
97
|
-
--wzl-space-lg: 16px;
|
|
130
|
+
--wzl-font-size: var(--wzl-font-size-md);
|
|
98
131
|
--wzl-tracking-none: 0;
|
|
99
132
|
/* Uppercase section headings. */
|
|
100
133
|
--wzl-tracking-wide: 0.06em;
|
|
@@ -128,21 +161,14 @@
|
|
|
128
161
|
--wzl-font-weight-normal: 300;
|
|
129
162
|
--wzl-font-weight-medium: 350;
|
|
130
163
|
--wzl-font-weight-bold: 400;
|
|
131
|
-
|
|
132
|
-
--wzl-
|
|
133
|
-
|
|
134
|
-
--wzl-
|
|
135
|
-
|
|
136
|
-
--wzl-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
--wzl-border-strong: var(--wzl-gray-400);
|
|
140
|
-
/* Accent for foreground use — text, icons, selected labels drawn on a surface. accent is a fill; the midnight base is too dim to read as text on dark surfaces. */
|
|
141
|
-
--wzl-accent-fg: var(--wzl-accent-strong);
|
|
142
|
-
/* Text drawn on a filled foreground-colored element (e.g. a slider thumb). Flips with the mode, so it is a semantic, not an alias to a primitive. */
|
|
143
|
-
--wzl-fg-inverse: var(--wzl-gray-900);
|
|
144
|
-
/* Elevation. Always darker than any surface — never derived from fg, which is near-white on dark. */
|
|
145
|
-
--wzl-shadow: rgba(0, 0, 0, 0.6);
|
|
164
|
+
/* Alias for space-2. The t-shirt names name every other rung of the ladder. */
|
|
165
|
+
--wzl-space-xs: var(--wzl-space-2);
|
|
166
|
+
/* Alias for space-4. The t-shirt names name every other rung of the ladder. */
|
|
167
|
+
--wzl-space-sm: var(--wzl-space-4);
|
|
168
|
+
/* Alias for space-6. The t-shirt names name every other rung of the ladder. */
|
|
169
|
+
--wzl-space-md: var(--wzl-space-6);
|
|
170
|
+
/* Alias for space-8. The t-shirt names name every other rung of the ladder. */
|
|
171
|
+
--wzl-space-lg: var(--wzl-space-8);
|
|
146
172
|
}
|
|
147
173
|
|
|
148
174
|
[data-wzl-theme='weasel'][data-wzl-mode='dark'],
|
|
@@ -186,3 +212,51 @@
|
|
|
186
212
|
--wzl-surface-hover: color-mix(in srgb, var(--wzl-fg) 10%, transparent);
|
|
187
213
|
--wzl-surface-pressed: color-mix(in srgb, var(--wzl-fg) 18%, transparent);
|
|
188
214
|
}
|
|
215
|
+
|
|
216
|
+
[data-wzl-theme='weasel'][data-wzl-density='compact'],
|
|
217
|
+
[data-wzl-density='compact'] {
|
|
218
|
+
--wzl-font-size-2xs: 7px;
|
|
219
|
+
--wzl-font-size-xs: 8px;
|
|
220
|
+
--wzl-font-size-sm: 9px;
|
|
221
|
+
--wzl-font-size-md: 11px;
|
|
222
|
+
--wzl-font-size-lg: 14px;
|
|
223
|
+
--wzl-font-size-xl: 17px;
|
|
224
|
+
--wzl-tb-height: 24px;
|
|
225
|
+
--wzl-control-h-xs: 16px;
|
|
226
|
+
--wzl-control-h-sm: 18px;
|
|
227
|
+
--wzl-control-h: 20px;
|
|
228
|
+
--wzl-icon-button-size: 20px;
|
|
229
|
+
--wzl-font-size: var(--wzl-font-size-md);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
[data-wzl-theme='weasel'][data-wzl-density='comfortable'],
|
|
233
|
+
[data-wzl-density='comfortable'] {
|
|
234
|
+
--wzl-font-size-2xs: 9px;
|
|
235
|
+
--wzl-font-size-xs: 10px;
|
|
236
|
+
--wzl-font-size-sm: 11px;
|
|
237
|
+
--wzl-font-size-md: 13px;
|
|
238
|
+
--wzl-font-size-lg: 16px;
|
|
239
|
+
--wzl-font-size-xl: 20px;
|
|
240
|
+
--wzl-tb-height: 28px;
|
|
241
|
+
--wzl-control-h-xs: 18px;
|
|
242
|
+
--wzl-control-h-sm: 20px;
|
|
243
|
+
--wzl-control-h: 24px;
|
|
244
|
+
--wzl-icon-button-size: 22px;
|
|
245
|
+
--wzl-font-size: var(--wzl-font-size-md);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
[data-wzl-theme='weasel'][data-wzl-density='roomy'],
|
|
249
|
+
[data-wzl-density='roomy'] {
|
|
250
|
+
--wzl-font-size-2xs: 10px;
|
|
251
|
+
--wzl-font-size-xs: 12px;
|
|
252
|
+
--wzl-font-size-sm: 13px;
|
|
253
|
+
--wzl-font-size-md: 15px;
|
|
254
|
+
--wzl-font-size-lg: 18px;
|
|
255
|
+
--wzl-font-size-xl: 23px;
|
|
256
|
+
--wzl-tb-height: 32px;
|
|
257
|
+
--wzl-control-h-xs: 22px;
|
|
258
|
+
--wzl-control-h-sm: 24px;
|
|
259
|
+
--wzl-control-h: 28px;
|
|
260
|
+
--wzl-icon-button-size: 26px;
|
|
261
|
+
--wzl-font-size: var(--wzl-font-size-md);
|
|
262
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weasel-js/theme",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "Design tokens shared by weasel-ui and weasel-hud — CSS variables + a parallel TS export.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -19,10 +19,17 @@
|
|
|
19
19
|
"import": "./dist/react.js",
|
|
20
20
|
"types": "./dist/react.d.ts"
|
|
21
21
|
},
|
|
22
|
+
"./engine": {
|
|
23
|
+
"import": "./dist/engine.js",
|
|
24
|
+
"types": "./dist/engine.d.ts"
|
|
25
|
+
},
|
|
22
26
|
"./tokens.css": "./dist/tokens.css",
|
|
23
27
|
"./fonts.css": "./dist/fonts.css",
|
|
24
28
|
"./package.json": "./package.json"
|
|
25
29
|
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@weasel-js/paint": "1.5.2"
|
|
32
|
+
},
|
|
26
33
|
"peerDependencies": {
|
|
27
34
|
"react": ">=18"
|
|
28
35
|
},
|