@elastic/distillate 0.1.0 → 0.2.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/dist/cjs/collector.js +129 -58
- package/dist/cjs/collector.js.map +1 -1
- package/dist/cjs/dom_sink.js +2 -2
- package/dist/cjs/dom_sink.js.map +1 -1
- package/dist/cjs/emotion.js.map +1 -1
- package/dist/cjs/engine.js +24 -8
- package/dist/cjs/engine.js.map +1 -1
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/sink.js +9 -0
- package/dist/cjs/sink.js.map +1 -0
- package/dist/collector.d.ts +18 -1
- package/dist/collector.d.ts.map +1 -1
- package/dist/collector.js +129 -58
- package/dist/collector.js.map +1 -1
- package/dist/dom_sink.d.ts +8 -12
- package/dist/dom_sink.d.ts.map +1 -1
- package/dist/dom_sink.js +2 -2
- package/dist/dom_sink.js.map +1 -1
- package/dist/emotion.d.ts +3 -6
- package/dist/emotion.d.ts.map +1 -1
- package/dist/emotion.js.map +1 -1
- package/dist/engine.d.ts +26 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +24 -8
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/sink.d.ts +16 -0
- package/dist/sink.d.ts.map +1 -0
- package/dist/sink.js +8 -0
- package/dist/sink.js.map +1 -0
- package/docs/concepts/collection.md +1 -1
- package/docs/getting-started/installation.md +5 -5
- package/docs/guides/react-renderer.md +45 -1
- package/docs/reference/api/emotion.md +58 -140
- package/docs/reference/api/index-1.md +452 -245
- package/docs/reference/api/testing.md +6 -6
- package/docs/reference/entry-points.md +18 -4
- package/docs/reference/okf-map.md +2 -1
- package/package.json +1 -1
- package/src/collector.ts +145 -59
- package/src/dom_sink.ts +9 -10
- package/src/emotion.ts +3 -6
- package/src/engine.ts +59 -9
- package/src/index.ts +14 -1
- package/src/sink.ts +25 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
### StyleRegistry [#styleregistry]
|
|
6
6
|
|
|
7
|
-
Defined in: [styles/registry.ts:22](https://github.com/elastic/distillate/blob/
|
|
7
|
+
Defined in: [styles/registry.ts:22](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/registry.ts#L22)
|
|
8
8
|
|
|
9
9
|
Registered style modules for one distillery. Throws on duplicate module names or colliding readable class/var names.
|
|
10
10
|
|
|
@@ -20,7 +20,7 @@ new StyleRegistry(
|
|
|
20
20
|
): StyleRegistry;
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Defined in: [styles/registry.ts:26](https://github.com/elastic/distillate/blob/
|
|
23
|
+
Defined in: [styles/registry.ts:26](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/registry.ts#L26)
|
|
24
24
|
|
|
25
25
|
###### Parameters
|
|
26
26
|
|
|
@@ -44,7 +44,7 @@ Defined in: [styles/registry.ts:26](https://github.com/elastic/distillate/blob/f
|
|
|
44
44
|
get classKeys(): readonly string[];
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
Defined in: [styles/registry.ts:98](https://github.com/elastic/distillate/blob/
|
|
47
|
+
Defined in: [styles/registry.ts:98](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/registry.ts#L98)
|
|
48
48
|
|
|
49
49
|
Handle keys across all modules. Compact-name domain for a full stylesheet.
|
|
50
50
|
|
|
@@ -60,7 +60,7 @@ readonly `string`[]
|
|
|
60
60
|
get cssVarKeys(): readonly string[];
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
Defined in: [styles/registry.ts:105](https://github.com/elastic/distillate/blob/
|
|
63
|
+
Defined in: [styles/registry.ts:105](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/registry.ts#L105)
|
|
64
64
|
|
|
65
65
|
Theme and contextual-var keys across all modules.
|
|
66
66
|
|
|
@@ -76,7 +76,7 @@ readonly `string`[]
|
|
|
76
76
|
get modules(): readonly StylesModule<StylesObject>[];
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
Defined in: [styles/registry.ts:86](https://github.com/elastic/distillate/blob/
|
|
79
|
+
Defined in: [styles/registry.ts:86](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/registry.ts#L86)
|
|
80
80
|
|
|
81
81
|
Registered modules, sorted by name.
|
|
82
82
|
|
|
@@ -92,7 +92,7 @@ readonly [`StylesModule`](#stylesmodule)\<[`StylesObject`](#stylesobject)\>[]
|
|
|
92
92
|
freeze(options?): StyleRegistrySnapshot;
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
Defined in: [styles/registry.ts:119](https://github.com/elastic/distillate/blob/
|
|
95
|
+
Defined in: [styles/registry.ts:119](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/registry.ts#L119)
|
|
96
96
|
|
|
97
97
|
Frozen class and CSS-var keys for a [StyleNameResolver](#stylenameresolver).
|
|
98
98
|
|
|
@@ -116,7 +116,7 @@ module(name):
|
|
|
116
116
|
| undefined;
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
Defined in: [styles/registry.ts:93](https://github.com/elastic/distillate/blob/
|
|
119
|
+
Defined in: [styles/registry.ts:93](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/registry.ts#L93)
|
|
120
120
|
|
|
121
121
|
Looks up a module by the name passed to `createStyleModule`.
|
|
122
122
|
|
|
@@ -137,7 +137,7 @@ Looks up a module by the name passed to `createStyleModule`.
|
|
|
137
137
|
registerModule(module): void;
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
Defined in: [styles/registry.ts:37](https://github.com/elastic/distillate/blob/
|
|
140
|
+
Defined in: [styles/registry.ts:37](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/registry.ts#L37)
|
|
141
141
|
|
|
142
142
|
Adds `module` to this registry.
|
|
143
143
|
|
|
@@ -161,7 +161,7 @@ If another module already uses this name, or if a readable class or CSS-variable
|
|
|
161
161
|
targetsHandle(key): boolean;
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
-
Defined in: [styles/registry.ts:61](https://github.com/elastic/distillate/blob/
|
|
164
|
+
Defined in: [styles/registry.ts:61](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/registry.ts#L61)
|
|
165
165
|
|
|
166
166
|
True when some rule, or some inner rule of an `@media` / `@container` block, reads `key` in its selector.
|
|
167
167
|
|
|
@@ -181,7 +181,7 @@ A nested `&` rule records its owning handle through `recordRuleDeps`, so a handl
|
|
|
181
181
|
|
|
182
182
|
### StylesCollector [#stylescollector]
|
|
183
183
|
|
|
184
|
-
Defined in: [collector.ts:101](https://github.com/elastic/distillate/blob/
|
|
184
|
+
Defined in: [collector.ts:101](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L101)
|
|
185
185
|
|
|
186
186
|
Reachable entries for one render or one stylesheet.
|
|
187
187
|
|
|
@@ -193,7 +193,7 @@ Reachable entries for one render or one stylesheet.
|
|
|
193
193
|
new StylesCollector(__namedParameters): StylesCollector;
|
|
194
194
|
```
|
|
195
195
|
|
|
196
|
-
Defined in: [collector.ts:
|
|
196
|
+
Defined in: [collector.ts:120](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L120)
|
|
197
197
|
|
|
198
198
|
###### Parameters
|
|
199
199
|
|
|
@@ -209,10 +209,10 @@ Defined in: [collector.ts:117](https://github.com/elastic/distillate/blob/f13191
|
|
|
209
209
|
|
|
210
210
|
| Property | Modifier | Type | Description | Defined in |
|
|
211
211
|
| ------ | ------ | ------ | ------ | ------ |
|
|
212
|
-
| $$$names$$$ `names` | `readonly` | [`StyleNameMode`](#stylenamemode) | The naming mode (compact vs readable). | [collector.ts:105](https://github.com/elastic/distillate/blob/
|
|
213
|
-
| $$$prefix$$$ `prefix` | `readonly` | `string` | Emitted class name prefix. | [collector.ts:109](https://github.com/elastic/distillate/blob/
|
|
214
|
-
| $$$registry$$$ `registry` | `readonly` | [`StyleRegistry`](#styleregistry) | Associated registry. | [collector.ts:107](https://github.com/elastic/distillate/blob/
|
|
215
|
-
| $$$target$$$ `target` | `readonly` | [`StyleTarget`](#styletarget) | The target collection mode. | [collector.ts:103](https://github.com/elastic/distillate/blob/
|
|
212
|
+
| $$$names$$$ `names` | `readonly` | [`StyleNameMode`](#stylenamemode) | The naming mode (compact vs readable). | [collector.ts:105](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L105) |
|
|
213
|
+
| $$$prefix$$$ `prefix` | `readonly` | `string` | Emitted class name prefix. | [collector.ts:109](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L109) |
|
|
214
|
+
| $$$registry$$$ `registry` | `readonly` | [`StyleRegistry`](#styleregistry) | Associated registry. | [collector.ts:107](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L107) |
|
|
215
|
+
| $$$target$$$ `target` | `readonly` | [`StyleTarget`](#styletarget) | The target collection mode. | [collector.ts:103](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L103) |
|
|
216
216
|
|
|
217
217
|
#### Accessors
|
|
218
218
|
|
|
@@ -224,7 +224,7 @@ Defined in: [collector.ts:117](https://github.com/elastic/distillate/blob/f13191
|
|
|
224
224
|
get collectedEntries(): readonly StyleEntry[];
|
|
225
225
|
```
|
|
226
226
|
|
|
227
|
-
Defined in: [collector.ts:
|
|
227
|
+
Defined in: [collector.ts:351](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L351)
|
|
228
228
|
|
|
229
229
|
Collected style entries sorted for emission (base rules before all `@media`/`@container` blocks).
|
|
230
230
|
|
|
@@ -240,7 +240,7 @@ readonly [`StyleEntry`](#styleentry)[]
|
|
|
240
240
|
get collectedThemeDeps(): ReadonlySet<string>;
|
|
241
241
|
```
|
|
242
242
|
|
|
243
|
-
Defined in: [collector.ts:
|
|
243
|
+
Defined in: [collector.ts:356](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L356)
|
|
244
244
|
|
|
245
245
|
Theme token paths that survive reachability; emitted in the theme scope block.
|
|
246
246
|
|
|
@@ -256,7 +256,7 @@ Theme token paths that survive reachability; emitted in the theme scope block.
|
|
|
256
256
|
get collectedVarDeps(): ReadonlySet<`vars/${string}`>;
|
|
257
257
|
```
|
|
258
258
|
|
|
259
|
-
Defined in: [collector.ts:
|
|
259
|
+
Defined in: [collector.ts:361](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L361)
|
|
260
260
|
|
|
261
261
|
Contextual var paths that survive reachability; used by the runtime for compact-name substitution.
|
|
262
262
|
|
|
@@ -272,7 +272,7 @@ Contextual var paths that survive reachability; used by the runtime for compact-
|
|
|
272
272
|
createResolver(): StyleNameResolver;
|
|
273
273
|
```
|
|
274
274
|
|
|
275
|
-
Defined in: [collector.ts:
|
|
275
|
+
Defined in: [collector.ts:333](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L333)
|
|
276
276
|
|
|
277
277
|
Creates a [StyleNameResolver](#stylenameresolver) scoped to this collector's current dep set.
|
|
278
278
|
|
|
@@ -286,7 +286,7 @@ Creates a [StyleNameResolver](#stylenameresolver) scoped to this collector's cur
|
|
|
286
286
|
reachableDefaults(handle, groupPath): ReadonlySet<string>;
|
|
287
287
|
```
|
|
288
288
|
|
|
289
|
-
Defined in: [collector.ts:
|
|
289
|
+
Defined in: [collector.ts:376](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L376)
|
|
290
290
|
|
|
291
291
|
Returns the variable keys within `groupPath` that are reachable from `handle` or from any collected rule targeting it.
|
|
292
292
|
|
|
@@ -301,13 +301,37 @@ Returns the variable keys within `groupPath` that are reachable from `handle` or
|
|
|
301
301
|
|
|
302
302
|
`ReadonlySet`\<`string`\>
|
|
303
303
|
|
|
304
|
+
##### subscribe() [#subscribe]
|
|
305
|
+
|
|
306
|
+
```ts
|
|
307
|
+
subscribe(listener): () => void;
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Defined in: [collector.ts:275](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L275)
|
|
311
|
+
|
|
312
|
+
Calls `listener` after a public mutation adds an entry, handle, theme var, or contextual var.
|
|
313
|
+
|
|
314
|
+
Fires at most once per outermost call; nested calls such as `use([a, b])` batch into it.
|
|
315
|
+
|
|
316
|
+
###### Parameters
|
|
317
|
+
|
|
318
|
+
| Parameter | Type | Description |
|
|
319
|
+
| ------ | ------ | ------ |
|
|
320
|
+
| `listener` | () => `void` | Called with no arguments after the collection grows. |
|
|
321
|
+
|
|
322
|
+
###### Returns
|
|
323
|
+
|
|
324
|
+
Unsubscribes `listener`.
|
|
325
|
+
|
|
326
|
+
() => `void`
|
|
327
|
+
|
|
304
328
|
##### use() [#use]
|
|
305
329
|
|
|
306
330
|
```ts
|
|
307
331
|
use(value): void;
|
|
308
332
|
```
|
|
309
333
|
|
|
310
|
-
Defined in: [collector.ts:
|
|
334
|
+
Defined in: [collector.ts:143](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L143)
|
|
311
335
|
|
|
312
336
|
Collects a module's non-variant entries, or one explicit entry.
|
|
313
337
|
|
|
@@ -329,7 +353,7 @@ Variant entries stay off this path; collect them via `useHandles`.
|
|
|
329
353
|
useAllEntries(module): void;
|
|
330
354
|
```
|
|
331
355
|
|
|
332
|
-
Defined in: [collector.ts:
|
|
356
|
+
Defined in: [collector.ts:196](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L196)
|
|
333
357
|
|
|
334
358
|
Collects every entry on `module`, including variants. Used by the stylesheet target.
|
|
335
359
|
|
|
@@ -349,11 +373,11 @@ Collects every entry on `module`, including variants. Used by the stylesheet tar
|
|
|
349
373
|
useHandles(handles): readonly StyleHandle[];
|
|
350
374
|
```
|
|
351
375
|
|
|
352
|
-
Defined in: [collector.ts:
|
|
376
|
+
Defined in: [collector.ts:222](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L222)
|
|
353
377
|
|
|
354
378
|
Collects handles and auto-includes rules whose selector deps are all present.
|
|
355
379
|
|
|
356
|
-
Media blocks
|
|
380
|
+
Media blocks gain inner rules whose deps are met and keep rules already collected.
|
|
357
381
|
|
|
358
382
|
###### Parameters
|
|
359
383
|
|
|
@@ -373,7 +397,7 @@ Handles that were retained. Empty untargeted handles are omitted in compact mode
|
|
|
373
397
|
useRulesWhenDepsMet(module): void;
|
|
374
398
|
```
|
|
375
399
|
|
|
376
|
-
Defined in: [collector.ts:
|
|
400
|
+
Defined in: [collector.ts:251](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L251)
|
|
377
401
|
|
|
378
402
|
Collects `auto` rules on `module` whose every selector dependency is already collected.
|
|
379
403
|
|
|
@@ -393,7 +417,7 @@ Collects `auto` rules on `module` whose every selector dependency is already col
|
|
|
393
417
|
useThemeVar(path): void;
|
|
394
418
|
```
|
|
395
419
|
|
|
396
|
-
Defined in: [collector.ts:
|
|
420
|
+
Defined in: [collector.ts:328](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L328)
|
|
397
421
|
|
|
398
422
|
Marks a theme token path as reachable so it appears in the emitted theme block, even if no collected declaration reads it.
|
|
399
423
|
|
|
@@ -411,7 +435,7 @@ Marks a theme token path as reachable so it appears in the emitted theme block,
|
|
|
411
435
|
|
|
412
436
|
### ContextualCssVar [#contextualcssvar]
|
|
413
437
|
|
|
414
|
-
Defined in: [tokens/contextual\_var.ts:25](https://github.com/elastic/distillate/blob/
|
|
438
|
+
Defined in: [tokens/contextual\_var.ts:25](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L25)
|
|
415
439
|
|
|
416
440
|
Represents a contextual CSS variable. Stringifies to `var(--...)`.
|
|
417
441
|
|
|
@@ -419,10 +443,10 @@ Represents a contextual CSS variable. Stringifies to `var(--...)`.
|
|
|
419
443
|
|
|
420
444
|
| Property | Modifier | Type | Description | Defined in |
|
|
421
445
|
| ------ | ------ | ------ | ------ | ------ |
|
|
422
|
-
| $$$__kind$$$ `__kind` | `readonly` | `"contextual-var"` | Brand for [isContextualCssVar](#iscontextualcssvar). | [tokens/contextual\_var.ts:27](https://github.com/elastic/distillate/blob/
|
|
423
|
-
| $$$name$$$ `name` | `readonly` | [`ContextualCssVarName`](#contextualcssvarname-1) | Wrapper yielding just the custom property name. | [tokens/contextual\_var.ts:31](https://github.com/elastic/distillate/blob/
|
|
424
|
-
| $$$path$$$ `path` | `readonly` | `` `vars/${string}` `` | Group/key path for this variable. | [tokens/contextual\_var.ts:29](https://github.com/elastic/distillate/blob/
|
|
425
|
-
| $$$ref$$$ `ref` | `readonly` | `` `var(--${string})` `` | Usable CSS `var(...)` reference string. | [tokens/contextual\_var.ts:33](https://github.com/elastic/distillate/blob/
|
|
446
|
+
| $$$__kind$$$ `__kind` | `readonly` | `"contextual-var"` | Brand for [isContextualCssVar](#iscontextualcssvar). | [tokens/contextual\_var.ts:27](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L27) |
|
|
447
|
+
| $$$name$$$ `name` | `readonly` | [`ContextualCssVarName`](#contextualcssvarname-1) | Wrapper yielding just the custom property name. | [tokens/contextual\_var.ts:31](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L31) |
|
|
448
|
+
| $$$path$$$ `path` | `readonly` | `` `vars/${string}` `` | Group/key path for this variable. | [tokens/contextual\_var.ts:29](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L29) |
|
|
449
|
+
| $$$ref$$$ `ref` | `readonly` | `` `var(--${string})` `` | Usable CSS `var(...)` reference string. | [tokens/contextual\_var.ts:33](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L33) |
|
|
426
450
|
|
|
427
451
|
#### Methods
|
|
428
452
|
|
|
@@ -432,7 +456,7 @@ Represents a contextual CSS variable. Stringifies to `var(--...)`.
|
|
|
432
456
|
toPrimitive: string;
|
|
433
457
|
```
|
|
434
458
|
|
|
435
|
-
Defined in: [tokens/contextual\_var.ts:37](https://github.com/elastic/distillate/blob/
|
|
459
|
+
Defined in: [tokens/contextual\_var.ts:37](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L37)
|
|
436
460
|
|
|
437
461
|
Template interpolation; same as [ContextualCssVar.toString](#tostring).
|
|
438
462
|
|
|
@@ -452,7 +476,7 @@ Template interpolation; same as [ContextualCssVar.toString](#tostring).
|
|
|
452
476
|
toString(): string;
|
|
453
477
|
```
|
|
454
478
|
|
|
455
|
-
Defined in: [tokens/contextual\_var.ts:35](https://github.com/elastic/distillate/blob/
|
|
479
|
+
Defined in: [tokens/contextual\_var.ts:35](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L35)
|
|
456
480
|
|
|
457
481
|
Stringifies to [ContextualCssVar.ref](#ref).
|
|
458
482
|
|
|
@@ -464,7 +488,7 @@ Stringifies to [ContextualCssVar.ref](#ref).
|
|
|
464
488
|
|
|
465
489
|
### ContextualCssVarName [#contextualcssvarname-1]
|
|
466
490
|
|
|
467
|
-
Defined in: [tokens/contextual\_var.ts:11](https://github.com/elastic/distillate/blob/
|
|
491
|
+
Defined in: [tokens/contextual\_var.ts:11](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L11)
|
|
468
492
|
|
|
469
493
|
Represents a contextual CSS variable name. Stringifies to its custom property name.
|
|
470
494
|
|
|
@@ -472,9 +496,9 @@ Represents a contextual CSS variable name. Stringifies to its custom property na
|
|
|
472
496
|
|
|
473
497
|
| Property | Modifier | Type | Description | Defined in |
|
|
474
498
|
| ------ | ------ | ------ | ------ | ------ |
|
|
475
|
-
| $$$__kind-1$$$ `__kind` | `readonly` | `"contextual-var-name"` | Brand for [isContextualCssVarName](#iscontextualcssvarname). | [tokens/contextual\_var.ts:13](https://github.com/elastic/distillate/blob/
|
|
476
|
-
| $$$name-1$$$ `name` | `readonly` | `` `--${string}` `` | Actual emitted CSS custom property name. | [tokens/contextual\_var.ts:17](https://github.com/elastic/distillate/blob/
|
|
477
|
-
| $$$path-1$$$ `path` | `readonly` | `` `vars/${string}` `` | Group/key path for this variable. | [tokens/contextual\_var.ts:15](https://github.com/elastic/distillate/blob/
|
|
499
|
+
| $$$__kind-1$$$ `__kind` | `readonly` | `"contextual-var-name"` | Brand for [isContextualCssVarName](#iscontextualcssvarname). | [tokens/contextual\_var.ts:13](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L13) |
|
|
500
|
+
| $$$name-1$$$ `name` | `readonly` | `` `--${string}` `` | Actual emitted CSS custom property name. | [tokens/contextual\_var.ts:17](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L17) |
|
|
501
|
+
| $$$path-1$$$ `path` | `readonly` | `` `vars/${string}` `` | Group/key path for this variable. | [tokens/contextual\_var.ts:15](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L15) |
|
|
478
502
|
|
|
479
503
|
#### Methods
|
|
480
504
|
|
|
@@ -484,7 +508,7 @@ Represents a contextual CSS variable name. Stringifies to its custom property na
|
|
|
484
508
|
toPrimitive: string;
|
|
485
509
|
```
|
|
486
510
|
|
|
487
|
-
Defined in: [tokens/contextual\_var.ts:21](https://github.com/elastic/distillate/blob/
|
|
511
|
+
Defined in: [tokens/contextual\_var.ts:21](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L21)
|
|
488
512
|
|
|
489
513
|
Template interpolation; same as [ContextualCssVarName.toString](#tostring-1).
|
|
490
514
|
|
|
@@ -504,7 +528,7 @@ Template interpolation; same as [ContextualCssVarName.toString](#tostring-1).
|
|
|
504
528
|
toString(): string;
|
|
505
529
|
```
|
|
506
530
|
|
|
507
|
-
Defined in: [tokens/contextual\_var.ts:19](https://github.com/elastic/distillate/blob/
|
|
531
|
+
Defined in: [tokens/contextual\_var.ts:19](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L19)
|
|
508
532
|
|
|
509
533
|
Stringifies to [ContextualCssVarName.name](#name-1).
|
|
510
534
|
|
|
@@ -514,9 +538,25 @@ Stringifies to [ContextualCssVarName.name](#name-1).
|
|
|
514
538
|
|
|
515
539
|
***
|
|
516
540
|
|
|
541
|
+
### CreateDomSinkOptions [#createdomsinkoptions]
|
|
542
|
+
|
|
543
|
+
Defined in: [dom\_sink.ts:21](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/dom_sink.ts#L21)
|
|
544
|
+
|
|
545
|
+
Host document and optional flush scheduler for a `<style>` sink.
|
|
546
|
+
|
|
547
|
+
#### Properties
|
|
548
|
+
|
|
549
|
+
| Property | Type | Description | Defined in |
|
|
550
|
+
| ------ | ------ | ------ | ------ |
|
|
551
|
+
| $$$document$$$ `document` | [`DocumentLike`](#documentlike) | Document that creates the style element. | [dom\_sink.ts:23](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/dom_sink.ts#L23) |
|
|
552
|
+
| $$$parent$$$ `parent?` | [`StyleParentLike`](#styleparentlike) | Node that receives the style element, e.g. a `ShadowRoot`. Defaults to `document.head`. | [dom\_sink.ts:25](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/dom_sink.ts#L25) |
|
|
553
|
+
| $$$schedule$$$ `schedule?` | (`flush`) => `void` | Defers the flush. Defaults to `queueMicrotask`. | [dom\_sink.ts:27](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/dom_sink.ts#L27) |
|
|
554
|
+
|
|
555
|
+
***
|
|
556
|
+
|
|
517
557
|
### CssToken [#csstoken]
|
|
518
558
|
|
|
519
|
-
Defined in: [tokens/theme\_token.ts:11](https://github.com/elastic/distillate/blob/
|
|
559
|
+
Defined in: [tokens/theme\_token.ts:11](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/theme_token.ts#L11)
|
|
520
560
|
|
|
521
561
|
Represents a CSS theme token. Stringifies to `var(--...)`.
|
|
522
562
|
|
|
@@ -524,10 +564,10 @@ Represents a CSS theme token. Stringifies to `var(--...)`.
|
|
|
524
564
|
|
|
525
565
|
| Property | Modifier | Type | Description | Defined in |
|
|
526
566
|
| ------ | ------ | ------ | ------ | ------ |
|
|
527
|
-
| $$$__kind-2$$$ `__kind` | `readonly` | `"theme-token"` | Brand for [isCssToken](#iscsstoken). | [tokens/theme\_token.ts:13](https://github.com/elastic/distillate/blob/
|
|
528
|
-
| $$$cssvar$$$ `cssVar` | `readonly` | `` `--${string}` `` | Actual emitted CSS custom property name. | [tokens/theme\_token.ts:17](https://github.com/elastic/distillate/blob/
|
|
529
|
-
| $$$path-2$$$ `path` | `readonly` | `string` | Path string mapping to this token in the environment. | [tokens/theme\_token.ts:15](https://github.com/elastic/distillate/blob/
|
|
530
|
-
| $$$ref-1$$$ `ref` | `readonly` | `` `var(--${string})` `` | Usable CSS `var(...)` reference string. | [tokens/theme\_token.ts:19](https://github.com/elastic/distillate/blob/
|
|
567
|
+
| $$$__kind-2$$$ `__kind` | `readonly` | `"theme-token"` | Brand for [isCssToken](#iscsstoken). | [tokens/theme\_token.ts:13](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/theme_token.ts#L13) |
|
|
568
|
+
| $$$cssvar$$$ `cssVar` | `readonly` | `` `--${string}` `` | Actual emitted CSS custom property name. | [tokens/theme\_token.ts:17](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/theme_token.ts#L17) |
|
|
569
|
+
| $$$path-2$$$ `path` | `readonly` | `string` | Path string mapping to this token in the environment. | [tokens/theme\_token.ts:15](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/theme_token.ts#L15) |
|
|
570
|
+
| $$$ref-1$$$ `ref` | `readonly` | `` `var(--${string})` `` | Usable CSS `var(...)` reference string. | [tokens/theme\_token.ts:19](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/theme_token.ts#L19) |
|
|
531
571
|
|
|
532
572
|
#### Methods
|
|
533
573
|
|
|
@@ -537,7 +577,7 @@ Represents a CSS theme token. Stringifies to `var(--...)`.
|
|
|
537
577
|
toPrimitive: string;
|
|
538
578
|
```
|
|
539
579
|
|
|
540
|
-
Defined in: [tokens/theme\_token.ts:23](https://github.com/elastic/distillate/blob/
|
|
580
|
+
Defined in: [tokens/theme\_token.ts:23](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/theme_token.ts#L23)
|
|
541
581
|
|
|
542
582
|
Template interpolation; same as [CssToken.toString](#tostring-2).
|
|
543
583
|
|
|
@@ -557,7 +597,7 @@ Template interpolation; same as [CssToken.toString](#tostring-2).
|
|
|
557
597
|
toString(): string;
|
|
558
598
|
```
|
|
559
599
|
|
|
560
|
-
Defined in: [tokens/theme\_token.ts:21](https://github.com/elastic/distillate/blob/
|
|
600
|
+
Defined in: [tokens/theme\_token.ts:21](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/theme_token.ts#L21)
|
|
561
601
|
|
|
562
602
|
Stringifies to [CssToken.ref](#ref-1).
|
|
563
603
|
|
|
@@ -569,7 +609,7 @@ Stringifies to [CssToken.ref](#ref-1).
|
|
|
569
609
|
|
|
570
610
|
### Declarations [#declarations]
|
|
571
611
|
|
|
572
|
-
Defined in: [styles/types.ts:97](https://github.com/elastic/distillate/blob/
|
|
612
|
+
Defined in: [styles/types.ts:97](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L97)
|
|
573
613
|
|
|
574
614
|
Authored CSS plus the deps the collector uses for reachability.
|
|
575
615
|
|
|
@@ -577,14 +617,14 @@ Authored CSS plus the deps the collector uses for reachability.
|
|
|
577
617
|
|
|
578
618
|
| Property | Modifier | Type | Description | Defined in |
|
|
579
619
|
| ------ | ------ | ------ | ------ | ------ |
|
|
580
|
-
| $$$css$$$ `css` | `readonly` | readonly [`DeclarationSegment`](#declarationsegment)[] | Interleaved literal CSS and local variable markers. | [styles/types.ts:99](https://github.com/elastic/distillate/blob/
|
|
581
|
-
| $$$deps$$$ `deps` | `readonly` | [`StyleDeps`](#styledeps) | Reachability tracking dependencies. | [styles/types.ts:101](https://github.com/elastic/distillate/blob/
|
|
620
|
+
| $$$css$$$ `css` | `readonly` | readonly [`DeclarationSegment`](#declarationsegment)[] | Interleaved literal CSS and local variable markers. | [styles/types.ts:99](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L99) |
|
|
621
|
+
| $$$deps$$$ `deps` | `readonly` | [`StyleDeps`](#styledeps) | Reachability tracking dependencies. | [styles/types.ts:101](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L101) |
|
|
582
622
|
|
|
583
623
|
***
|
|
584
624
|
|
|
585
625
|
### DefaultGroupDeps [#defaultgroupdeps]
|
|
586
626
|
|
|
587
|
-
Defined in: [styles/types.ts:59](https://github.com/elastic/distillate/blob/
|
|
627
|
+
Defined in: [styles/types.ts:59](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L59)
|
|
588
628
|
|
|
589
629
|
One `t.vars(...)` group's default-emission metadata.
|
|
590
630
|
|
|
@@ -592,14 +632,14 @@ One `t.vars(...)` group's default-emission metadata.
|
|
|
592
632
|
|
|
593
633
|
| Property | Modifier | Type | Description | Defined in |
|
|
594
634
|
| ------ | ------ | ------ | ------ | ------ |
|
|
595
|
-
| $$$grouppath$$$ `groupPath` | `readonly` | `` `vars/${string}` `` | Target variable namespace group. | [styles/types.ts:61](https://github.com/elastic/distillate/blob/
|
|
596
|
-
| $$$keys$$$ `keys` | `readonly` | readonly [`DefaultKeyDeps`](#defaultkeydeps)[] | Defaults registered within this group. | [styles/types.ts:63](https://github.com/elastic/distillate/blob/
|
|
635
|
+
| $$$grouppath$$$ `groupPath` | `readonly` | `` `vars/${string}` `` | Target variable namespace group. | [styles/types.ts:61](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L61) |
|
|
636
|
+
| $$$keys$$$ `keys` | `readonly` | readonly [`DefaultKeyDeps`](#defaultkeydeps)[] | Defaults registered within this group. | [styles/types.ts:63](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L63) |
|
|
597
637
|
|
|
598
638
|
***
|
|
599
639
|
|
|
600
640
|
### DefaultKeyDeps [#defaultkeydeps]
|
|
601
641
|
|
|
602
|
-
Defined in: [styles/types.ts:67](https://github.com/elastic/distillate/blob/
|
|
642
|
+
Defined in: [styles/types.ts:67](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L67)
|
|
603
643
|
|
|
604
644
|
One key inside a [DefaultGroupDeps](#defaultgroupdeps) group.
|
|
605
645
|
|
|
@@ -607,17 +647,17 @@ One key inside a [DefaultGroupDeps](#defaultgroupdeps) group.
|
|
|
607
647
|
|
|
608
648
|
| Property | Modifier | Type | Description | Defined in |
|
|
609
649
|
| ------ | ------ | ------ | ------ | ------ |
|
|
610
|
-
| $$$key$$$ `key` | `readonly` | `string` | The specific variable key within the group. | [styles/types.ts:69](https://github.com/elastic/distillate/blob/
|
|
611
|
-
| $$$path-3$$$ `path` | `readonly` | `` `vars/${string}` `` | Full CSS variable path (e.g. `vars/group/key`). | [styles/types.ts:71](https://github.com/elastic/distillate/blob/
|
|
612
|
-
| $$$valuedeps$$$ `valueDeps` | `readonly` | `object` | Theme/var paths referenced by the default value. Kept if the key is reachable. | [styles/types.ts:73](https://github.com/elastic/distillate/blob/
|
|
613
|
-
| `valueDeps.theme` | `readonly` | `ReadonlySet`\<`string`\> | Theme-token paths the default value interpolates. | [styles/types.ts:75](https://github.com/elastic/distillate/blob/
|
|
614
|
-
| `valueDeps.vars` | `readonly` | `ReadonlySet`\<`` `vars/${string}` ``\> | Contextual-var paths the default value interpolates. | [styles/types.ts:77](https://github.com/elastic/distillate/blob/
|
|
650
|
+
| $$$key$$$ `key` | `readonly` | `string` | The specific variable key within the group. | [styles/types.ts:69](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L69) |
|
|
651
|
+
| $$$path-3$$$ `path` | `readonly` | `` `vars/${string}` `` | Full CSS variable path (e.g. `vars/group/key`). | [styles/types.ts:71](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L71) |
|
|
652
|
+
| $$$valuedeps$$$ `valueDeps` | `readonly` | `object` | Theme/var paths referenced by the default value. Kept if the key is reachable. | [styles/types.ts:73](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L73) |
|
|
653
|
+
| `valueDeps.theme` | `readonly` | `ReadonlySet`\<`string`\> | Theme-token paths the default value interpolates. | [styles/types.ts:75](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L75) |
|
|
654
|
+
| `valueDeps.vars` | `readonly` | `ReadonlySet`\<`` `vars/${string}` ``\> | Contextual-var paths the default value interpolates. | [styles/types.ts:77](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L77) |
|
|
615
655
|
|
|
616
656
|
***
|
|
617
657
|
|
|
618
658
|
### Distillery [#distillery]
|
|
619
659
|
|
|
620
|
-
Defined in: [engine.ts:
|
|
660
|
+
Defined in: [engine.ts:69](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L69)
|
|
621
661
|
|
|
622
662
|
One component library's binding: environment, registry, and pre-bound operations. Destructure-safe (no `this`).
|
|
623
663
|
|
|
@@ -632,24 +672,25 @@ One component library's binding: environment, registry, and pre-bound operations
|
|
|
632
672
|
|
|
633
673
|
| Property | Modifier | Type | Description | Defined in |
|
|
634
674
|
| ------ | ------ | ------ | ------ | ------ |
|
|
635
|
-
| $$$artifactcollector$$$ `artifactCollector` | `readonly` | (`names`, `options?`) => [`StylesCollector`](#stylescollector) | Collector for one render. Class-name resolution collects as a side effect. No-op warnings require `dev: true`; pass `{ warn }` to capture them. | [engine.ts:
|
|
636
|
-
| $$$createnameresolver$$$ `createNameResolver` | `readonly` | (`options`) => [`StyleNameResolver`](#stylenameresolver) | Creates a standalone name resolver using this distillery's prefix. | [engine.ts:
|
|
637
|
-
| $$$createstylemodule$$$ `createStyleModule` | `readonly` | \<`TStyles`\>(`name`, `factory`) => [`StylesModule`](#stylesmodule)\<[`ResolvedStyles`](#resolvedstyles)\<`TStyles`\>\> | Named handle tree plus tokens. | [engine.ts:
|
|
638
|
-
| $$$dev$$$ `dev` | `readonly` | `boolean` | When `true`, collectors warn about no-op handles. | [engine.ts:
|
|
639
|
-
| $$$environment$$$ `environment` | `readonly` | [`DistilleryEnvironment`](#distilleryenvironment-1)\<`TTokens`\> | Resolved environment (tokens, prefix, derived theme vars). | [engine.ts:
|
|
640
|
-
| $$$
|
|
641
|
-
| $$$
|
|
642
|
-
| $$$
|
|
643
|
-
| $$$
|
|
644
|
-
| $$$
|
|
645
|
-
| $$$
|
|
646
|
-
| $$$
|
|
675
|
+
| $$$artifactcollector$$$ `artifactCollector` | `readonly` | (`names`, `options?`) => [`StylesCollector`](#stylescollector) | Collector for one render. Class-name resolution collects as a side effect. No-op warnings require `dev: true`; pass `{ warn }` to capture them. | [engine.ts:99](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L99) |
|
|
676
|
+
| $$$createnameresolver$$$ `createNameResolver` | `readonly` | (`options`) => [`StyleNameResolver`](#stylenameresolver) | Creates a standalone name resolver using this distillery's prefix. | [engine.ts:117](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L117) |
|
|
677
|
+
| $$$createstylemodule$$$ `createStyleModule` | `readonly` | \<`TStyles`\>(`name`, `factory`) => [`StylesModule`](#stylesmodule)\<[`ResolvedStyles`](#resolvedstyles)\<`TStyles`\>\> | Named handle tree plus tokens. | [engine.ts:89](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L89) |
|
|
678
|
+
| $$$dev$$$ `dev` | `readonly` | `boolean` | When `true`, collectors warn about no-op handles. | [engine.ts:87](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L87) |
|
|
679
|
+
| $$$environment$$$ `environment` | `readonly` | [`DistilleryEnvironment`](#distilleryenvironment-1)\<`TTokens`\> | Resolved environment (tokens, prefix, derived theme vars). | [engine.ts:74](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L74) |
|
|
680
|
+
| $$$livecollection$$$ `liveCollection` | `readonly` | (`options?`) => [`LiveCollection`](#livecollection-1) | Readable collection for one live render; keeps `sink` current as handles resolve. | [engine.ts:109](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L109) |
|
|
681
|
+
| $$$primitivestyles$$$ `primitiveStyles` | `readonly` | \<`TStyles`\>(`name`, `factory`) => [`StylesModule`](#stylesmodule)\<[`ResolvedStyles`](#resolvedstyles)\<`TStyles`\>\> | Named handles plus tokens only. | [engine.ts:94](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L94) |
|
|
682
|
+
| $$$registry-1$$$ `registry` | `readonly` | [`StyleRegistry`](#styleregistry) | The module registry accumulating collected handles and rules. | [engine.ts:85](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L85) |
|
|
683
|
+
| $$$renderstyles$$$ `renderStyles` | `readonly` | (`collector`, `resolver?`, `options?`) => `string` | Emits collected CSS for this environment. | [engine.ts:111](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L111) |
|
|
684
|
+
| $$$resolvevalues$$$ `resolveValues` | `readonly` | (`scheme`, `variation?`) => [`ValuesOf`](#valuesof)\<`TTheme`\> | Nested literal values for one scheme. Optional `variation` is a name from `variations`. | [engine.ts:80](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L80) |
|
|
685
|
+
| $$$stylesheetcollector$$$ `stylesheetCollector` | `readonly` | (`names?`, `options?`) => [`StylesCollector`](#stylescollector) | Collector preloaded with every registered module. No-op warnings require `dev: true`; pass `{ warn }` to capture them. | [engine.ts:104](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L104) |
|
|
686
|
+
| $$$themevars$$$ `themeVars` | `readonly` | `Readonly`\<`Record`\<`string`, [`ThemeVarDefinition`](#themevardefinition)\>\> | Derived theme-var registry, same object as `environment.themeVars`. | [engine.ts:78](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L78) |
|
|
687
|
+
| $$$tokens$$$ `tokens` | `readonly` | `TTokens` | Derived token tree, same object as `environment.tokens`. | [engine.ts:76](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L76) |
|
|
647
688
|
|
|
648
689
|
***
|
|
649
690
|
|
|
650
691
|
### DistilleryEnvironment [#distilleryenvironment-1]
|
|
651
692
|
|
|
652
|
-
Defined in: [environment.ts:43](https://github.com/elastic/distillate/blob/
|
|
693
|
+
Defined in: [environment.ts:43](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L43)
|
|
653
694
|
|
|
654
695
|
Resolved environment: derived `themeVars` / `tokens` plus the bind-time prefix and scope.
|
|
655
696
|
|
|
@@ -663,18 +704,18 @@ Resolved environment: derived `themeVars` / `tokens` plus the bind-time prefix a
|
|
|
663
704
|
|
|
664
705
|
| Property | Modifier | Type | Description | Defined in |
|
|
665
706
|
| ------ | ------ | ------ | ------ | ------ |
|
|
666
|
-
| $$$prefix-1$$$ `prefix` | `readonly` | `string` | Brand identifier used in readable class and CSS-variable names. Must be a CSS identifier segment. | [environment.ts:45](https://github.com/elastic/distillate/blob/
|
|
667
|
-
| $$$sharedvars$$$ `sharedVars?` | `readonly` | `ReadonlySet`\<`` `vars/${string}` ``\> | Cross-module contextual-var paths. Module-local `vars(...)` groups are not listed here. | [environment.ts:51](https://github.com/elastic/distillate/blob/
|
|
668
|
-
| $$$themescope$$$ `themeScope` | `readonly` | `string` | Selector wrapping emitted theme-var declarations. | [environment.ts:47](https://github.com/elastic/distillate/blob/
|
|
669
|
-
| $$$themevars-1$$$ `themeVars` | `readonly` | `Readonly`\<`Record`\<`string`, [`ThemeVarDefinition`](#themevardefinition)\>\> | Theme token path → definition. Emission sorts paths. | [environment.ts:49](https://github.com/elastic/distillate/blob/
|
|
670
|
-
| $$$tokens-1$$$ `tokens` | `readonly` | `TTokens` | Typed token tree, surfaced as `tokens` on the authoring API. | [environment.ts:53](https://github.com/elastic/distillate/blob/
|
|
671
|
-
| $$$variations$$$ `variations?` | `readonly` | `Readonly`\<`Record`\<`string`, [`ResolvedThemeVariation`](#resolvedthemevariation)\>\> | Named variations resolved against `themeVars`. Absent when no `variations` were declared. | [environment.ts:55](https://github.com/elastic/distillate/blob/
|
|
707
|
+
| $$$prefix-1$$$ `prefix` | `readonly` | `string` | Brand identifier used in readable class and CSS-variable names. Must be a CSS identifier segment. | [environment.ts:45](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L45) |
|
|
708
|
+
| $$$sharedvars$$$ `sharedVars?` | `readonly` | `ReadonlySet`\<`` `vars/${string}` ``\> | Cross-module contextual-var paths. Module-local `vars(...)` groups are not listed here. | [environment.ts:51](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L51) |
|
|
709
|
+
| $$$themescope$$$ `themeScope` | `readonly` | `string` | Selector wrapping emitted theme-var declarations. | [environment.ts:47](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L47) |
|
|
710
|
+
| $$$themevars-1$$$ `themeVars` | `readonly` | `Readonly`\<`Record`\<`string`, [`ThemeVarDefinition`](#themevardefinition)\>\> | Theme token path → definition. Emission sorts paths. | [environment.ts:49](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L49) |
|
|
711
|
+
| $$$tokens-1$$$ `tokens` | `readonly` | `TTokens` | Typed token tree, surfaced as `tokens` on the authoring API. | [environment.ts:53](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L53) |
|
|
712
|
+
| $$$variations$$$ `variations?` | `readonly` | `Readonly`\<`Record`\<`string`, [`ResolvedThemeVariation`](#resolvedthemevariation)\>\> | Named variations resolved against `themeVars`. Absent when no `variations` were declared. | [environment.ts:55](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L55) |
|
|
672
713
|
|
|
673
714
|
***
|
|
674
715
|
|
|
675
716
|
### DistilleryOptions [#distilleryoptions]
|
|
676
717
|
|
|
677
|
-
Defined in: [environment.ts:27](https://github.com/elastic/distillate/blob/
|
|
718
|
+
Defined in: [environment.ts:27](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L27)
|
|
678
719
|
|
|
679
720
|
Authoring input to `createDistillery`.
|
|
680
721
|
|
|
@@ -688,18 +729,88 @@ Authoring input to `createDistillery`.
|
|
|
688
729
|
|
|
689
730
|
| Property | Modifier | Type | Description | Defined in |
|
|
690
731
|
| ------ | ------ | ------ | ------ | ------ |
|
|
691
|
-
| $$$dev-1$$$ `dev?` | `readonly` | `boolean` | When `true`, collectors warn about no-op handles. Default `false`. Does not affect the single-copy guard. | [environment.ts:39](https://github.com/elastic/distillate/blob/
|
|
692
|
-
| $$$prefix-2$$$ `prefix` | `readonly` | `string` | Brand identifier used in readable class and CSS-variable names. Must be a CSS identifier segment. | [environment.ts:29](https://github.com/elastic/distillate/blob/
|
|
693
|
-
| $$$sharedvars-1$$$ `sharedVars?` | `readonly` | readonly `` `vars/${string}` ``[] | Cross-module contextual-var paths. Names are `cssVarName(prefix, path)`. Module-local `vars(...)` groups are not listed here. | [environment.ts:37](https://github.com/elastic/distillate/blob/
|
|
694
|
-
| $$$theme$$$ `theme` | `readonly` | `TTheme` | Nested value tree. Strings and `lightDark` leaves become theme vars; `ScaleToken` leaves inline. | [environment.ts:33](https://github.com/elastic/distillate/blob/
|
|
695
|
-
| $$$themescope-1$$$ `themeScope` | `readonly` | `string` | Selector wrapping emitted theme-var declarations. | [environment.ts:31](https://github.com/elastic/distillate/blob/
|
|
696
|
-
| $$$variations-1$$$ `variations?` | `readonly` | `Readonly`\<`Record`\<`string`, [`ThemeVariation`](#themevariation)\<`TTheme`\>\>\> | Named partial variations of `theme`. Declaring a variation does not emit it; name it at `renderStyles`. | [environment.ts:35](https://github.com/elastic/distillate/blob/
|
|
732
|
+
| $$$dev-1$$$ `dev?` | `readonly` | `boolean` | When `true`, collectors warn about no-op handles. Default `false`. Does not affect the single-copy guard. | [environment.ts:39](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L39) |
|
|
733
|
+
| $$$prefix-2$$$ `prefix` | `readonly` | `string` | Brand identifier used in readable class and CSS-variable names. Must be a CSS identifier segment. | [environment.ts:29](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L29) |
|
|
734
|
+
| $$$sharedvars-1$$$ `sharedVars?` | `readonly` | readonly `` `vars/${string}` ``[] | Cross-module contextual-var paths. Names are `cssVarName(prefix, path)`. Module-local `vars(...)` groups are not listed here. | [environment.ts:37](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L37) |
|
|
735
|
+
| $$$theme$$$ `theme` | `readonly` | `TTheme` | Nested value tree. Strings and `lightDark` leaves become theme vars; `ScaleToken` leaves inline. | [environment.ts:33](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L33) |
|
|
736
|
+
| $$$themescope-1$$$ `themeScope` | `readonly` | `string` | Selector wrapping emitted theme-var declarations. | [environment.ts:31](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L31) |
|
|
737
|
+
| $$$variations-1$$$ `variations?` | `readonly` | `Readonly`\<`Record`\<`string`, [`ThemeVariation`](#themevariation)\<`TTheme`\>\>\> | Named partial variations of `theme`. Declaring a variation does not emit it; name it at `renderStyles`. | [environment.ts:35](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L35) |
|
|
738
|
+
|
|
739
|
+
***
|
|
740
|
+
|
|
741
|
+
### DocumentLike [#documentlike]
|
|
742
|
+
|
|
743
|
+
Defined in: [dom\_sink.ts:13](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/dom_sink.ts#L13)
|
|
744
|
+
|
|
745
|
+
Minimal interface for a DOM `Document` able to create and append style tags.
|
|
746
|
+
|
|
747
|
+
#### Properties
|
|
748
|
+
|
|
749
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
750
|
+
| ------ | ------ | ------ | ------ | ------ |
|
|
751
|
+
| $$$head$$$ `head` | `readonly` | [`StyleParentLike`](#styleparentlike) | Default parent for the created style element. | [dom\_sink.ts:17](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/dom_sink.ts#L17) |
|
|
752
|
+
|
|
753
|
+
#### Methods
|
|
754
|
+
|
|
755
|
+
##### createElement() [#createelement]
|
|
756
|
+
|
|
757
|
+
```ts
|
|
758
|
+
createElement(tagName): StyleElementLike;
|
|
759
|
+
```
|
|
760
|
+
|
|
761
|
+
Defined in: [dom\_sink.ts:15](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/dom_sink.ts#L15)
|
|
762
|
+
|
|
763
|
+
Creates a `<style>` element.
|
|
764
|
+
|
|
765
|
+
###### Parameters
|
|
766
|
+
|
|
767
|
+
| Parameter | Type |
|
|
768
|
+
| ------ | ------ |
|
|
769
|
+
| `tagName` | `"style"` |
|
|
770
|
+
|
|
771
|
+
###### Returns
|
|
772
|
+
|
|
773
|
+
[`StyleElementLike`](#styleelementlike)
|
|
774
|
+
|
|
775
|
+
***
|
|
776
|
+
|
|
777
|
+
### LiveCollection [#livecollection-1]
|
|
778
|
+
|
|
779
|
+
Defined in: [engine.ts:59](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L59)
|
|
780
|
+
|
|
781
|
+
Readable collection filled by one live render.
|
|
782
|
+
|
|
783
|
+
Readable only: compact names depend on the complete collected set and need two passes.
|
|
784
|
+
|
|
785
|
+
#### Properties
|
|
786
|
+
|
|
787
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
788
|
+
| ------ | ------ | ------ | ------ | ------ |
|
|
789
|
+
| $$$collector$$$ `collector` | `readonly` | [`StylesCollector`](#stylescollector) | Underlying readable artifact collector. Mutations here (e.g. `use(globalModule)`, `useThemeVar`) also invalidate the sink. | [engine.ts:61](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L61) |
|
|
790
|
+
| $$$css-1$$$ `css` | `readonly` | () => `string` | Renders the CSS collected so far. | [engine.ts:65](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L65) |
|
|
791
|
+
| $$$resolveclassname$$$ `resolveClassName` | `readonly` | (...`handles`) => `string` | Collects `handles` and returns their readable class names, space-separated. | [engine.ts:63](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L63) |
|
|
792
|
+
|
|
793
|
+
***
|
|
794
|
+
|
|
795
|
+
### LiveCollectionOptions [#livecollectionoptions]
|
|
796
|
+
|
|
797
|
+
Defined in: [engine.ts:45](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L45)
|
|
798
|
+
|
|
799
|
+
Sink, render options, and warning sink for [Distillery.liveCollection](#livecollection).
|
|
800
|
+
|
|
801
|
+
#### Properties
|
|
802
|
+
|
|
803
|
+
| Property | Type | Description | Defined in |
|
|
804
|
+
| ------ | ------ | ------ | ------ |
|
|
805
|
+
| $$$render$$$ `render?` | [`RenderStylesOptions`](#renderstylesoptions) | Options forwarded to `renderStyles` by `css()`. | [engine.ts:49](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L49) |
|
|
806
|
+
| $$$sink$$$ `sink?` | [`StyleSink`](#stylesink) | Invalidated whenever the collection grows. Nothing is written before the first handle. | [engine.ts:47](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L47) |
|
|
807
|
+
| $$$warn$$$ `warn?` | (`message`) => `void` | Warning sink for no-op handles. Used only when the distillery has `dev: true`. | [engine.ts:51](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L51) |
|
|
697
808
|
|
|
698
809
|
***
|
|
699
810
|
|
|
700
811
|
### LocalVarDefaultMarker [#localvardefaultmarker]
|
|
701
812
|
|
|
702
|
-
Defined in: [local\_vars.ts:53](https://github.com/elastic/distillate/blob/
|
|
813
|
+
Defined in: [local\_vars.ts:53](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L53)
|
|
703
814
|
|
|
704
815
|
Interpolation marker representing `${group}` defaults.
|
|
705
816
|
|
|
@@ -707,16 +818,16 @@ Interpolation marker representing `${group}` defaults.
|
|
|
707
818
|
|
|
708
819
|
| Property | Modifier | Type | Description | Defined in |
|
|
709
820
|
| ------ | ------ | ------ | ------ | ------ |
|
|
710
|
-
| $$$__kind-3$$$ `__kind` | `readonly` | `"local-var-default-marker"` | Brand distinguishing a `${group}` default marker. | [local\_vars.ts:55](https://github.com/elastic/distillate/blob/
|
|
711
|
-
| $$$defaults$$$ `defaults` | `readonly` | readonly `object`[] | Ordered list of variable defaults. | [local\_vars.ts:61](https://github.com/elastic/distillate/blob/
|
|
712
|
-
| $$$groupid$$$ `groupId` | `readonly` | `string` | Unique ID for the group. | [local\_vars.ts:57](https://github.com/elastic/distillate/blob/
|
|
713
|
-
| $$$grouppath-1$$$ `groupPath` | `readonly` | `` `vars/${string}` `` | Group prefix path. | [local\_vars.ts:59](https://github.com/elastic/distillate/blob/
|
|
821
|
+
| $$$__kind-3$$$ `__kind` | `readonly` | `"local-var-default-marker"` | Brand distinguishing a `${group}` default marker. | [local\_vars.ts:55](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L55) |
|
|
822
|
+
| $$$defaults$$$ `defaults` | `readonly` | readonly `object`[] | Ordered list of variable defaults. | [local\_vars.ts:61](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L61) |
|
|
823
|
+
| $$$groupid$$$ `groupId` | `readonly` | `string` | Unique ID for the group. | [local\_vars.ts:57](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L57) |
|
|
824
|
+
| $$$grouppath-1$$$ `groupPath` | `readonly` | `` `vars/${string}` `` | Group prefix path. | [local\_vars.ts:59](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L59) |
|
|
714
825
|
|
|
715
826
|
***
|
|
716
827
|
|
|
717
828
|
### LocalVarOverrideMarker [#localvaroverridemarker]
|
|
718
829
|
|
|
719
|
-
Defined in: [local\_vars.ts:34](https://github.com/elastic/distillate/blob/
|
|
830
|
+
Defined in: [local\_vars.ts:34](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L34)
|
|
720
831
|
|
|
721
832
|
Interpolation marker representing `.set(...)` overrides.
|
|
722
833
|
|
|
@@ -724,15 +835,15 @@ Interpolation marker representing `.set(...)` overrides.
|
|
|
724
835
|
|
|
725
836
|
| Property | Modifier | Type | Description | Defined in |
|
|
726
837
|
| ------ | ------ | ------ | ------ | ------ |
|
|
727
|
-
| $$$__kind-4$$$ `__kind` | `readonly` | `"local-var-override-marker"` | Brand distinguishing a `.set(...)` override marker. | [local\_vars.ts:36](https://github.com/elastic/distillate/blob/
|
|
728
|
-
| $$$groupid-1$$$ `groupId` | `readonly` | `string` | Unique ID for the group. | [local\_vars.ts:38](https://github.com/elastic/distillate/blob/
|
|
729
|
-
| $$$overrides$$$ `overrides` | `readonly` | readonly `object`[] | Ordered list of variable overrides. | [local\_vars.ts:40](https://github.com/elastic/distillate/blob/
|
|
838
|
+
| $$$__kind-4$$$ `__kind` | `readonly` | `"local-var-override-marker"` | Brand distinguishing a `.set(...)` override marker. | [local\_vars.ts:36](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L36) |
|
|
839
|
+
| $$$groupid-1$$$ `groupId` | `readonly` | `string` | Unique ID for the group. | [local\_vars.ts:38](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L38) |
|
|
840
|
+
| $$$overrides$$$ `overrides` | `readonly` | readonly `object`[] | Ordered list of variable overrides. | [local\_vars.ts:40](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L40) |
|
|
730
841
|
|
|
731
842
|
***
|
|
732
843
|
|
|
733
844
|
### LocalVarRef [#localvarref]
|
|
734
845
|
|
|
735
|
-
Defined in: [local\_vars.ts:18](https://github.com/elastic/distillate/blob/
|
|
846
|
+
Defined in: [local\_vars.ts:18](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L18)
|
|
736
847
|
|
|
737
848
|
Reference to a local CSS variable. Stringifies to `var(--...)`.
|
|
738
849
|
|
|
@@ -740,10 +851,10 @@ Reference to a local CSS variable. Stringifies to `var(--...)`.
|
|
|
740
851
|
|
|
741
852
|
| Property | Modifier | Type | Description | Defined in |
|
|
742
853
|
| ------ | ------ | ------ | ------ | ------ |
|
|
743
|
-
| $$$__kind-5$$$ `__kind` | `readonly` | `"local-var-ref"` | Brand distinguishing a local-var ref from other interpolations. | [local\_vars.ts:20](https://github.com/elastic/distillate/blob/
|
|
744
|
-
| $$$path-4$$$ `path` | `readonly` | `` `vars/${string}` `` | Canonical group/key path. | [local\_vars.ts:22](https://github.com/elastic/distillate/blob/
|
|
745
|
-
| $$$propname$$$ `propName` | `readonly` | `` `--${string}` `` | Actual emitted CSS custom property name. | [local\_vars.ts:24](https://github.com/elastic/distillate/blob/
|
|
746
|
-
| $$$ref-2$$$ `ref` | `readonly` | `` `var(--${string})` `` | Usable CSS `var(...)` reference string. | [local\_vars.ts:26](https://github.com/elastic/distillate/blob/
|
|
854
|
+
| $$$__kind-5$$$ `__kind` | `readonly` | `"local-var-ref"` | Brand distinguishing a local-var ref from other interpolations. | [local\_vars.ts:20](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L20) |
|
|
855
|
+
| $$$path-4$$$ `path` | `readonly` | `` `vars/${string}` `` | Canonical group/key path. | [local\_vars.ts:22](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L22) |
|
|
856
|
+
| $$$propname$$$ `propName` | `readonly` | `` `--${string}` `` | Actual emitted CSS custom property name. | [local\_vars.ts:24](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L24) |
|
|
857
|
+
| $$$ref-2$$$ `ref` | `readonly` | `` `var(--${string})` `` | Usable CSS `var(...)` reference string. | [local\_vars.ts:26](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L26) |
|
|
747
858
|
|
|
748
859
|
#### Methods
|
|
749
860
|
|
|
@@ -753,7 +864,7 @@ Reference to a local CSS variable. Stringifies to `var(--...)`.
|
|
|
753
864
|
toPrimitive: string;
|
|
754
865
|
```
|
|
755
866
|
|
|
756
|
-
Defined in: [local\_vars.ts:30](https://github.com/elastic/distillate/blob/
|
|
867
|
+
Defined in: [local\_vars.ts:30](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L30)
|
|
757
868
|
|
|
758
869
|
Template interpolation; same as [LocalVarRef.toString](#tostring-3).
|
|
759
870
|
|
|
@@ -773,7 +884,7 @@ Template interpolation; same as [LocalVarRef.toString](#tostring-3).
|
|
|
773
884
|
toString(): string;
|
|
774
885
|
```
|
|
775
886
|
|
|
776
|
-
Defined in: [local\_vars.ts:28](https://github.com/elastic/distillate/blob/
|
|
887
|
+
Defined in: [local\_vars.ts:28](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L28)
|
|
777
888
|
|
|
778
889
|
Stringifies to [LocalVarRef.ref](#ref-2).
|
|
779
890
|
|
|
@@ -785,7 +896,7 @@ Stringifies to [LocalVarRef.ref](#ref-2).
|
|
|
785
896
|
|
|
786
897
|
### MediaThemeVariation [#mediathemevariation]
|
|
787
898
|
|
|
788
|
-
Defined in: [theme.ts:89](https://github.com/elastic/distillate/blob/
|
|
899
|
+
Defined in: [theme.ts:89](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L89)
|
|
789
900
|
|
|
790
901
|
Media-conditioned variation. `media` is intrinsic; it is not a selector.
|
|
791
902
|
|
|
@@ -799,14 +910,14 @@ Media-conditioned variation. `media` is intrinsic; it is not a selector.
|
|
|
799
910
|
|
|
800
911
|
| Property | Modifier | Type | Description | Defined in |
|
|
801
912
|
| ------ | ------ | ------ | ------ | ------ |
|
|
802
|
-
| $$$media$$$ `media` | `readonly` | `string` | Media query wrapping this variation's emitted diffs. | [theme.ts:91](https://github.com/elastic/distillate/blob/
|
|
803
|
-
| $$$variation$$$ `variation` | `readonly` | [`DeepPartialTheme`](#deeppartialtheme)\<`T`\> | Partial variation of the base theme. | [theme.ts:93](https://github.com/elastic/distillate/blob/
|
|
913
|
+
| $$$media$$$ `media` | `readonly` | `string` | Media query wrapping this variation's emitted diffs. | [theme.ts:91](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L91) |
|
|
914
|
+
| $$$variation$$$ `variation` | `readonly` | [`DeepPartialTheme`](#deeppartialtheme)\<`T`\> | Partial variation of the base theme. | [theme.ts:93](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L93) |
|
|
804
915
|
|
|
805
916
|
***
|
|
806
917
|
|
|
807
918
|
### PrimitiveStyleAuthoringApi [#primitivestyleauthoringapi]
|
|
808
919
|
|
|
809
|
-
Defined in: [styles/types.ts:278](https://github.com/elastic/distillate/blob/
|
|
920
|
+
Defined in: [styles/types.ts:278](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L278)
|
|
810
921
|
|
|
811
922
|
Narrow `t` for `primitiveStyles`: handles and tokens only.
|
|
812
923
|
|
|
@@ -820,14 +931,14 @@ Narrow `t` for `primitiveStyles`: handles and tokens only.
|
|
|
820
931
|
|
|
821
932
|
| Property | Type | Description | Defined in |
|
|
822
933
|
| ------ | ------ | ------ | ------ |
|
|
823
|
-
| $$$style$$$ `style` | (`strings`, ...`values`) => `PendingStyleHandle` | Creates named style handles using the same template tag as `css`. | [styles/types.ts:280](https://github.com/elastic/distillate/blob/
|
|
824
|
-
| $$$tokens-2$$$ `tokens` | `TTokens` | Environment token tree. | [styles/types.ts:282](https://github.com/elastic/distillate/blob/
|
|
934
|
+
| $$$style$$$ `style` | (`strings`, ...`values`) => `PendingStyleHandle` | Creates named style handles using the same template tag as `css`. | [styles/types.ts:280](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L280) |
|
|
935
|
+
| $$$tokens-2$$$ `tokens` | `TTokens` | Environment token tree. | [styles/types.ts:282](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L282) |
|
|
825
936
|
|
|
826
937
|
***
|
|
827
938
|
|
|
828
939
|
### RenderStylesOptions [#renderstylesoptions]
|
|
829
940
|
|
|
830
|
-
Defined in: [runtime.ts:67](https://github.com/elastic/distillate/blob/
|
|
941
|
+
Defined in: [runtime.ts:67](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/runtime.ts#L67)
|
|
831
942
|
|
|
832
943
|
Per-render variation selection, scheme flatten, alternate blocks, and value overrides.
|
|
833
944
|
|
|
@@ -835,16 +946,16 @@ Per-render variation selection, scheme flatten, alternate blocks, and value over
|
|
|
835
946
|
|
|
836
947
|
| Property | Type | Description | Defined in |
|
|
837
948
|
| ------ | ------ | ------ | ------ |
|
|
838
|
-
| $$$alternates$$$ `alternates?` | readonly [`ThemeAlternate`](#themealternate)[] | Extra blocks for runtime switching. Each entry emits only the variation's diff. | [runtime.ts:77](https://github.com/elastic/distillate/blob/
|
|
839
|
-
| $$$flatten$$$ `flatten?` | `string` | Flatten this declared variation into `themeScope`. Default is the base. A media variation does not replace the primary block; it wraps its diffs in `@media`. | [runtime.ts:69](https://github.com/elastic/distillate/blob/
|
|
840
|
-
| $$$scheme$$$ `scheme?` | `"light"` \| `"dark"` | Emit one scheme's literal instead of `light-dark(...)`. For a target with no color scheme to resolve the function against — an image or PDF backend, email HTML, an older browser. | [runtime.ts:75](https://github.com/elastic/distillate/blob/
|
|
841
|
-
| $$$themevalueoverrides$$$ `themeValueOverrides?` | `Partial`\<`Record`\<`string`, `string`\>\> | Override a theme token's emitted value. | [runtime.ts:79](https://github.com/elastic/distillate/blob/
|
|
949
|
+
| $$$alternates$$$ `alternates?` | readonly [`ThemeAlternate`](#themealternate)[] | Extra blocks for runtime switching. Each entry emits only the variation's diff. | [runtime.ts:77](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/runtime.ts#L77) |
|
|
950
|
+
| $$$flatten$$$ `flatten?` | `string` | Flatten this declared variation into `themeScope`. Default is the base. A media variation does not replace the primary block; it wraps its diffs in `@media`. | [runtime.ts:69](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/runtime.ts#L69) |
|
|
951
|
+
| $$$scheme$$$ `scheme?` | `"light"` \| `"dark"` | Emit one scheme's literal instead of `light-dark(...)`. For a target with no color scheme to resolve the function against — an image or PDF backend, email HTML, an older browser. | [runtime.ts:75](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/runtime.ts#L75) |
|
|
952
|
+
| $$$themevalueoverrides$$$ `themeValueOverrides?` | `Partial`\<`Record`\<`string`, `string`\>\> | Override a theme token's emitted value. | [runtime.ts:79](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/runtime.ts#L79) |
|
|
842
953
|
|
|
843
954
|
***
|
|
844
955
|
|
|
845
956
|
### ResolvedThemeVariation [#resolvedthemevariation]
|
|
846
957
|
|
|
847
|
-
Defined in: [theme.ts:101](https://github.com/elastic/distillate/blob/
|
|
958
|
+
Defined in: [theme.ts:101](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L101)
|
|
848
959
|
|
|
849
960
|
One named variation resolved against the base at construction.
|
|
850
961
|
|
|
@@ -852,16 +963,16 @@ One named variation resolved against the base at construction.
|
|
|
852
963
|
|
|
853
964
|
| Property | Modifier | Type | Description | Defined in |
|
|
854
965
|
| ------ | ------ | ------ | ------ | ------ |
|
|
855
|
-
| $$$diffs$$$ `diffs` | `readonly` | `Readonly`\<`Record`\<`string`, [`ThemeVarDefinition`](#themevardefinition)\>\> | Paths whose serialized value differs from the base. | [theme.ts:109](https://github.com/elastic/distillate/blob/
|
|
856
|
-
| $$$media-1$$$ `media?` | `readonly` | `string` | Intrinsic media query, when declared. | [theme.ts:105](https://github.com/elastic/distillate/blob/
|
|
857
|
-
| $$$name-2$$$ `name` | `readonly` | `string` | Name passed in `variations`. | [theme.ts:103](https://github.com/elastic/distillate/blob/
|
|
858
|
-
| $$$themevars-2$$$ `themeVars` | `readonly` | `Readonly`\<`Record`\<`string`, [`ThemeVarDefinition`](#themevardefinition)\>\> | Base theme vars with this variation applied. | [theme.ts:107](https://github.com/elastic/distillate/blob/
|
|
966
|
+
| $$$diffs$$$ `diffs` | `readonly` | `Readonly`\<`Record`\<`string`, [`ThemeVarDefinition`](#themevardefinition)\>\> | Paths whose serialized value differs from the base. | [theme.ts:109](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L109) |
|
|
967
|
+
| $$$media-1$$$ `media?` | `readonly` | `string` | Intrinsic media query, when declared. | [theme.ts:105](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L105) |
|
|
968
|
+
| $$$name-2$$$ `name` | `readonly` | `string` | Name passed in `variations`. | [theme.ts:103](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L103) |
|
|
969
|
+
| $$$themevars-2$$$ `themeVars` | `readonly` | `Readonly`\<`Record`\<`string`, [`ThemeVarDefinition`](#themevardefinition)\>\> | Base theme vars with this variation applied. | [theme.ts:107](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L107) |
|
|
859
970
|
|
|
860
971
|
***
|
|
861
972
|
|
|
862
973
|
### RuleOptions [#ruleoptions]
|
|
863
974
|
|
|
864
|
-
Defined in: [styles/types.ts:148](https://github.com/elastic/distillate/blob/
|
|
975
|
+
Defined in: [styles/types.ts:148](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L148)
|
|
865
976
|
|
|
866
977
|
Options for [rule](#rule).
|
|
867
978
|
|
|
@@ -869,13 +980,13 @@ Options for [rule](#rule).
|
|
|
869
980
|
|
|
870
981
|
| Property | Type | Description | Defined in |
|
|
871
982
|
| ------ | ------ | ------ | ------ |
|
|
872
|
-
| $$$auto$$$ `auto?` | `boolean` | When `false`, the collector must `use` this rule explicitly. Defaults to `true`. | [styles/types.ts:150](https://github.com/elastic/distillate/blob/
|
|
983
|
+
| $$$auto$$$ `auto?` | `boolean` | When `false`, the collector must `use` this rule explicitly. Defaults to `true`. | [styles/types.ts:150](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L150) |
|
|
873
984
|
|
|
874
985
|
***
|
|
875
986
|
|
|
876
987
|
### ScaleToken [#scaletoken]
|
|
877
988
|
|
|
878
|
-
Defined in: [tokens/scale\_token.ts:11](https://github.com/elastic/distillate/blob/
|
|
989
|
+
Defined in: [tokens/scale\_token.ts:11](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/scale_token.ts#L11)
|
|
879
990
|
|
|
880
991
|
Represents a CSS scale size token. Stringifies to its literal value.
|
|
881
992
|
|
|
@@ -883,9 +994,9 @@ Represents a CSS scale size token. Stringifies to its literal value.
|
|
|
883
994
|
|
|
884
995
|
| Property | Modifier | Type | Description | Defined in |
|
|
885
996
|
| ------ | ------ | ------ | ------ | ------ |
|
|
886
|
-
| $$$__kind-6$$$ `__kind` | `readonly` | `"scale-token"` | Brand for [isScaleToken](#isscaletoken). | [tokens/scale\_token.ts:13](https://github.com/elastic/distillate/blob/
|
|
887
|
-
| $$$cq$$$ `cq` | `readonly` | `string` | Container-query-relative variant of `value`. | [tokens/scale\_token.ts:17](https://github.com/elastic/distillate/blob/
|
|
888
|
-
| $$$value$$$ `value` | `readonly` | `string` | Literal CSS value, inlined into declarations. | [tokens/scale\_token.ts:15](https://github.com/elastic/distillate/blob/
|
|
997
|
+
| $$$__kind-6$$$ `__kind` | `readonly` | `"scale-token"` | Brand for [isScaleToken](#isscaletoken). | [tokens/scale\_token.ts:13](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/scale_token.ts#L13) |
|
|
998
|
+
| $$$cq$$$ `cq` | `readonly` | `string` | Container-query-relative variant of `value`. | [tokens/scale\_token.ts:17](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/scale_token.ts#L17) |
|
|
999
|
+
| $$$value$$$ `value` | `readonly` | `string` | Literal CSS value, inlined into declarations. | [tokens/scale\_token.ts:15](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/scale_token.ts#L15) |
|
|
889
1000
|
|
|
890
1001
|
#### Methods
|
|
891
1002
|
|
|
@@ -895,7 +1006,7 @@ Represents a CSS scale size token. Stringifies to its literal value.
|
|
|
895
1006
|
toPrimitive: string;
|
|
896
1007
|
```
|
|
897
1008
|
|
|
898
|
-
Defined in: [tokens/scale\_token.ts:21](https://github.com/elastic/distillate/blob/
|
|
1009
|
+
Defined in: [tokens/scale\_token.ts:21](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/scale_token.ts#L21)
|
|
899
1010
|
|
|
900
1011
|
Template interpolation; same as [ScaleToken.toString](#tostring-4).
|
|
901
1012
|
|
|
@@ -915,7 +1026,7 @@ Template interpolation; same as [ScaleToken.toString](#tostring-4).
|
|
|
915
1026
|
toString(): string;
|
|
916
1027
|
```
|
|
917
1028
|
|
|
918
|
-
Defined in: [tokens/scale\_token.ts:19](https://github.com/elastic/distillate/blob/
|
|
1029
|
+
Defined in: [tokens/scale\_token.ts:19](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/scale_token.ts#L19)
|
|
919
1030
|
|
|
920
1031
|
Stringifies to [ScaleToken.value](#value).
|
|
921
1032
|
|
|
@@ -927,7 +1038,7 @@ Stringifies to [ScaleToken.value](#value).
|
|
|
927
1038
|
|
|
928
1039
|
### SchemePair [#schemepair]
|
|
929
1040
|
|
|
930
|
-
Defined in: [tokens/light\_dark.ts:11](https://github.com/elastic/distillate/blob/
|
|
1041
|
+
Defined in: [tokens/light\_dark.ts:11](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/light_dark.ts#L11)
|
|
931
1042
|
|
|
932
1043
|
Scheme-varying color pair. Compiles to `light-dark(light, dark)`.
|
|
933
1044
|
|
|
@@ -935,15 +1046,15 @@ Scheme-varying color pair. Compiles to `light-dark(light, dark)`.
|
|
|
935
1046
|
|
|
936
1047
|
| Property | Modifier | Type | Description | Defined in |
|
|
937
1048
|
| ------ | ------ | ------ | ------ | ------ |
|
|
938
|
-
| $$$__kind-7$$$ `__kind` | `readonly` | `"scheme-pair"` | Brand for isSchemePair. | [tokens/light\_dark.ts:13](https://github.com/elastic/distillate/blob/
|
|
939
|
-
| $$$dark$$$ `dark` | `readonly` | `string` | Dark color-scheme value. Must be a CSS `<color>`. | [tokens/light\_dark.ts:17](https://github.com/elastic/distillate/blob/
|
|
940
|
-
| $$$light$$$ `light` | `readonly` | `string` | Light color-scheme value. Must be a CSS `<color>`. | [tokens/light\_dark.ts:15](https://github.com/elastic/distillate/blob/
|
|
1049
|
+
| $$$__kind-7$$$ `__kind` | `readonly` | `"scheme-pair"` | Brand for isSchemePair. | [tokens/light\_dark.ts:13](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/light_dark.ts#L13) |
|
|
1050
|
+
| $$$dark$$$ `dark` | `readonly` | `string` | Dark color-scheme value. Must be a CSS `<color>`. | [tokens/light\_dark.ts:17](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/light_dark.ts#L17) |
|
|
1051
|
+
| $$$light$$$ `light` | `readonly` | `string` | Light color-scheme value. Must be a CSS `<color>`. | [tokens/light\_dark.ts:15](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/light_dark.ts#L15) |
|
|
941
1052
|
|
|
942
1053
|
***
|
|
943
1054
|
|
|
944
1055
|
### StyleAuthoringApi [#styleauthoringapi]
|
|
945
1056
|
|
|
946
|
-
Defined in: [styles/types.ts:219](https://github.com/elastic/distillate/blob/
|
|
1057
|
+
Defined in: [styles/types.ts:219](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L219)
|
|
947
1058
|
|
|
948
1059
|
Authoring API passed to `createStyleModule` factories.
|
|
949
1060
|
|
|
@@ -957,16 +1068,16 @@ Authoring API passed to `createStyleModule` factories.
|
|
|
957
1068
|
|
|
958
1069
|
| Property | Type | Description | Defined in |
|
|
959
1070
|
| ------ | ------ | ------ | ------ |
|
|
960
|
-
| $$$css-
|
|
961
|
-
| $$$decls$$$ `decls` | (`strings`, ...`values`) => [`Declarations`](#declarations) | Creates a declaration block template for direct CSS properties. | [styles/types.ts:226](https://github.com/elastic/distillate/blob/
|
|
962
|
-
| $$$tokens-3$$$ `tokens` | `TTokens` | Environment token tree. | [styles/types.ts:236](https://github.com/elastic/distillate/blob/
|
|
963
|
-
| $$$vars$$$ `vars` | \<`TKey`\>(`group`, `defaults`) => [`LocalVarGroup`](#localvargroup)\<`TKey`\> | Module-local CSS variable group. Interpolate `${group}`, `${group.key}`, or `${group.set({...})}`. | [styles/types.ts:231](https://github.com/elastic/distillate/blob/
|
|
1071
|
+
| $$$css-2$$$ `css` | (`strings`, ...`values`) => `PendingStyleHandle` | Creates a handle template where nested `&` and `@media` flatten into sibling rules. | [styles/types.ts:221](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L221) |
|
|
1072
|
+
| $$$decls$$$ `decls` | (`strings`, ...`values`) => [`Declarations`](#declarations) | Creates a declaration block template for direct CSS properties. | [styles/types.ts:226](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L226) |
|
|
1073
|
+
| $$$tokens-3$$$ `tokens` | `TTokens` | Environment token tree. | [styles/types.ts:236](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L236) |
|
|
1074
|
+
| $$$vars$$$ `vars` | \<`TKey`\>(`group`, `defaults`) => [`LocalVarGroup`](#localvargroup)\<`TKey`\> | Module-local CSS variable group. Interpolate `${group}`, `${group.key}`, or `${group.set({...})}`. | [styles/types.ts:231](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L231) |
|
|
964
1075
|
|
|
965
1076
|
***
|
|
966
1077
|
|
|
967
1078
|
### StyleDeps [#styledeps]
|
|
968
1079
|
|
|
969
|
-
Defined in: [styles/types.ts:47](https://github.com/elastic/distillate/blob/
|
|
1080
|
+
Defined in: [styles/types.ts:47](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L47)
|
|
970
1081
|
|
|
971
1082
|
Reachability sets captured while authoring a declaration block.
|
|
972
1083
|
|
|
@@ -974,16 +1085,30 @@ Reachability sets captured while authoring a declaration block.
|
|
|
974
1085
|
|
|
975
1086
|
| Property | Modifier | Type | Description | Defined in |
|
|
976
1087
|
| ------ | ------ | ------ | ------ | ------ |
|
|
977
|
-
| $$$defaults-1$$$ `defaults` | `readonly` | readonly [`DefaultGroupDeps`](#defaultgroupdeps)[] | `t.vars(...)` default-emission sites, resolved after collection. | [styles/types.ts:55](https://github.com/elastic/distillate/blob/
|
|
978
|
-
| $$$refs$$$ `refs` | `readonly` | `ReadonlySet`\<`` `vars/${string}` ``\> | Read-side `var(...)` paths. Drives default-emission reachability. | [styles/types.ts:53](https://github.com/elastic/distillate/blob/
|
|
979
|
-
| $$$theme-1$$$ `theme` | `readonly` | `ReadonlySet`\<`string`\> | Theme-token paths interpolated into this block. | [styles/types.ts:49](https://github.com/elastic/distillate/blob/
|
|
980
|
-
| $$$vars-1$$$ `vars` | `readonly` | `ReadonlySet`\<`` `vars/${string}` ``\> | Unconditional writes and reads. Default-marker keys land here only when reachable. | [styles/types.ts:51](https://github.com/elastic/distillate/blob/
|
|
1088
|
+
| $$$defaults-1$$$ `defaults` | `readonly` | readonly [`DefaultGroupDeps`](#defaultgroupdeps)[] | `t.vars(...)` default-emission sites, resolved after collection. | [styles/types.ts:55](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L55) |
|
|
1089
|
+
| $$$refs$$$ `refs` | `readonly` | `ReadonlySet`\<`` `vars/${string}` ``\> | Read-side `var(...)` paths. Drives default-emission reachability. | [styles/types.ts:53](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L53) |
|
|
1090
|
+
| $$$theme-1$$$ `theme` | `readonly` | `ReadonlySet`\<`string`\> | Theme-token paths interpolated into this block. | [styles/types.ts:49](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L49) |
|
|
1091
|
+
| $$$vars-1$$$ `vars` | `readonly` | `ReadonlySet`\<`` `vars/${string}` ``\> | Unconditional writes and reads. Default-marker keys land here only when reachable. | [styles/types.ts:51](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L51) |
|
|
1092
|
+
|
|
1093
|
+
***
|
|
1094
|
+
|
|
1095
|
+
### StyleElementLike [#styleelementlike]
|
|
1096
|
+
|
|
1097
|
+
Defined in: [sink.ts:15](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/sink.ts#L15)
|
|
1098
|
+
|
|
1099
|
+
Minimal interface for a DOM `<style>` element.
|
|
1100
|
+
|
|
1101
|
+
#### Properties
|
|
1102
|
+
|
|
1103
|
+
| Property | Type | Description | Defined in |
|
|
1104
|
+
| ------ | ------ | ------ | ------ |
|
|
1105
|
+
| $$$textcontent$$$ `textContent` | `string` \| `null` | Current stylesheet text, or `null` before the first flush. | [sink.ts:17](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/sink.ts#L17) |
|
|
981
1106
|
|
|
982
1107
|
***
|
|
983
1108
|
|
|
984
1109
|
### StyleHandle [#stylehandle]
|
|
985
1110
|
|
|
986
|
-
Defined in: [styles/types.ts:105](https://github.com/elastic/distillate/blob/
|
|
1111
|
+
Defined in: [styles/types.ts:105](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L105)
|
|
987
1112
|
|
|
988
1113
|
A named class: readable name, declarations, and collection identity.
|
|
989
1114
|
|
|
@@ -995,23 +1120,23 @@ A named class: readable name, declarations, and collection identity.
|
|
|
995
1120
|
|
|
996
1121
|
| Property | Modifier | Type | Description | Defined in |
|
|
997
1122
|
| ------ | ------ | ------ | ------ | ------ |
|
|
998
|
-
| $$$declarations-1$$$ `declarations` | `readonly` | [`Declarations`](#declarations) | CSS properties for this handle. | [styles/types.ts:117](https://github.com/elastic/distillate/blob/
|
|
999
|
-
| $$$key-1$$$ `key` | `readonly` | `string` | Full path joined by dots. | [styles/types.ts:113](https://github.com/elastic/distillate/blob/
|
|
1000
|
-
| $$$kind$$$ `kind` | `readonly` | `"handle"` | Discriminant for [StyleEntry](#styleentry). | [styles/types.ts:107](https://github.com/elastic/distillate/blob/
|
|
1001
|
-
| $$$localname$$$ `localName` | `readonly` | `string` | Leaf key if at root, or composed path for nested handles. | [styles/types.ts:111](https://github.com/elastic/distillate/blob/
|
|
1002
|
-
| $$$modulename$$$ `moduleName` | `readonly` | `string` | The registered module name this handle belongs to. | [styles/types.ts:109](https://github.com/elastic/distillate/blob/
|
|
1003
|
-
| $$$readablename$$$ `readableName` | `readonly` | `string` | Predictable name used for output CSS classes. | [styles/types.ts:115](https://github.com/elastic/distillate/blob/
|
|
1004
|
-
| $$$variant$$$ `variant` | `readonly` | `boolean` | `true` when produced inside `variants(...)`. Skipped by [StylesCollector.use](#use). | [styles/types.ts:119](https://github.com/elastic/distillate/blob/
|
|
1123
|
+
| $$$declarations-1$$$ `declarations` | `readonly` | [`Declarations`](#declarations) | CSS properties for this handle. | [styles/types.ts:117](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L117) |
|
|
1124
|
+
| $$$key-1$$$ `key` | `readonly` | `string` | Full path joined by dots. | [styles/types.ts:113](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L113) |
|
|
1125
|
+
| $$$kind$$$ `kind` | `readonly` | `"handle"` | Discriminant for [StyleEntry](#styleentry). | [styles/types.ts:107](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L107) |
|
|
1126
|
+
| $$$localname$$$ `localName` | `readonly` | `string` | Leaf key if at root, or composed path for nested handles. | [styles/types.ts:111](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L111) |
|
|
1127
|
+
| $$$modulename$$$ `moduleName` | `readonly` | `string` | The registered module name this handle belongs to. | [styles/types.ts:109](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L109) |
|
|
1128
|
+
| $$$readablename$$$ `readableName` | `readonly` | `string` | Predictable name used for output CSS classes. | [styles/types.ts:115](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L115) |
|
|
1129
|
+
| $$$variant$$$ `variant` | `readonly` | `boolean` | `true` when produced inside `variants(...)`. Skipped by [StylesCollector.use](#use). | [styles/types.ts:119](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L119) |
|
|
1005
1130
|
|
|
1006
1131
|
#### Methods
|
|
1007
1132
|
|
|
1008
|
-
##### resolveClassName() [#resolveclassname]
|
|
1133
|
+
##### resolveClassName() [#resolveclassname-1]
|
|
1009
1134
|
|
|
1010
1135
|
```ts
|
|
1011
1136
|
resolveClassName(context): string;
|
|
1012
1137
|
```
|
|
1013
1138
|
|
|
1014
|
-
Defined in: [styles/types.ts:121](https://github.com/elastic/distillate/blob/
|
|
1139
|
+
Defined in: [styles/types.ts:121](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L121)
|
|
1015
1140
|
|
|
1016
1141
|
Produces the final class name via the provided resolver context.
|
|
1017
1142
|
|
|
@@ -1030,7 +1155,7 @@ Produces the final class name via the provided resolver context.
|
|
|
1030
1155
|
|
|
1031
1156
|
### StyleMedia [#stylemedia]
|
|
1032
1157
|
|
|
1033
|
-
Defined in: [styles/types.ts:154](https://github.com/elastic/distillate/blob/
|
|
1158
|
+
Defined in: [styles/types.ts:154](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L154)
|
|
1034
1159
|
|
|
1035
1160
|
`@media` or `@container` block wrapping inner [StyleRule](#stylerule)s.
|
|
1036
1161
|
|
|
@@ -1038,19 +1163,19 @@ Defined in: [styles/types.ts:154](https://github.com/elastic/distillate/blob/f13
|
|
|
1038
1163
|
|
|
1039
1164
|
| Property | Modifier | Type | Description | Defined in |
|
|
1040
1165
|
| ------ | ------ | ------ | ------ | ------ |
|
|
1041
|
-
| $$$atrule$$$ `atRule?` | `readonly` | `"media"` \| `"container"` | At-rule this entry emits. `kind` stays `'media'` so collector rank and deps apply uniformly; see finding `media-block-ordering`. | [styles/types.ts:160](https://github.com/elastic/distillate/blob/
|
|
1042
|
-
| $$$key-2$$$ `key` | `readonly` | `string` | Stable identity for deduplication across multiple renders. | [styles/types.ts:162](https://github.com/elastic/distillate/blob/
|
|
1043
|
-
| $$$kind-1$$$ `kind` | `readonly` | `"media"` | Discriminant for [StyleEntry](#styleentry). | [styles/types.ts:156](https://github.com/elastic/distillate/blob/
|
|
1044
|
-
| $$$modulename-1$$$ `moduleName` | `readonly` | `string` | The registered module name this media block belongs to. | [styles/types.ts:164](https://github.com/elastic/distillate/blob/
|
|
1045
|
-
| $$$query$$$ `query` | `readonly` | `string` | The conditional query (e.g. `(min-width: 600px)`). | [styles/types.ts:166](https://github.com/elastic/distillate/blob/
|
|
1046
|
-
| $$$rules$$$ `rules` | `readonly` | readonly [`StyleRule`](#stylerule)[] | Inner rules collected inside this block. | [styles/types.ts:168](https://github.com/elastic/distillate/blob/
|
|
1047
|
-
| $$$variant-1$$$ `variant` | `readonly` | `boolean` | `true` when produced inside `variants(...)`. | [styles/types.ts:170](https://github.com/elastic/distillate/blob/
|
|
1166
|
+
| $$$atrule$$$ `atRule?` | `readonly` | `"media"` \| `"container"` | At-rule this entry emits. `kind` stays `'media'` so collector rank and deps apply uniformly; see finding `media-block-ordering`. | [styles/types.ts:160](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L160) |
|
|
1167
|
+
| $$$key-2$$$ `key` | `readonly` | `string` | Stable identity for deduplication across multiple renders. | [styles/types.ts:162](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L162) |
|
|
1168
|
+
| $$$kind-1$$$ `kind` | `readonly` | `"media"` | Discriminant for [StyleEntry](#styleentry). | [styles/types.ts:156](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L156) |
|
|
1169
|
+
| $$$modulename-1$$$ `moduleName` | `readonly` | `string` | The registered module name this media block belongs to. | [styles/types.ts:164](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L164) |
|
|
1170
|
+
| $$$query$$$ `query` | `readonly` | `string` | The conditional query (e.g. `(min-width: 600px)`). | [styles/types.ts:166](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L166) |
|
|
1171
|
+
| $$$rules$$$ `rules` | `readonly` | readonly [`StyleRule`](#stylerule)[] | Inner rules collected inside this block. | [styles/types.ts:168](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L168) |
|
|
1172
|
+
| $$$variant-1$$$ `variant` | `readonly` | `boolean` | `true` when produced inside `variants(...)`. | [styles/types.ts:170](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L170) |
|
|
1048
1173
|
|
|
1049
1174
|
***
|
|
1050
1175
|
|
|
1051
1176
|
### StyleNameResolver [#stylenameresolver]
|
|
1052
1177
|
|
|
1053
|
-
Defined in: [names.ts:14](https://github.com/elastic/distillate/blob/
|
|
1178
|
+
Defined in: [names.ts:14](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/names.ts#L14)
|
|
1054
1179
|
|
|
1055
1180
|
Context for resolving keys into final class or custom-property names.
|
|
1056
1181
|
|
|
@@ -1058,7 +1183,7 @@ Context for resolving keys into final class or custom-property names.
|
|
|
1058
1183
|
|
|
1059
1184
|
| Property | Modifier | Type | Description | Defined in |
|
|
1060
1185
|
| ------ | ------ | ------ | ------ | ------ |
|
|
1061
|
-
| $$$names-1$$$ `names` | `readonly` | [`StyleNameMode`](#stylenamemode) | The naming mode used by this resolver. | [names.ts:16](https://github.com/elastic/distillate/blob/
|
|
1186
|
+
| $$$names-1$$$ `names` | `readonly` | [`StyleNameMode`](#stylenamemode) | The naming mode used by this resolver. | [names.ts:16](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/names.ts#L16) |
|
|
1062
1187
|
|
|
1063
1188
|
#### Methods
|
|
1064
1189
|
|
|
@@ -1068,7 +1193,7 @@ Context for resolving keys into final class or custom-property names.
|
|
|
1068
1193
|
className(key, readableName?): string;
|
|
1069
1194
|
```
|
|
1070
1195
|
|
|
1071
|
-
Defined in: [names.ts:18](https://github.com/elastic/distillate/blob/
|
|
1196
|
+
Defined in: [names.ts:18](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/names.ts#L18)
|
|
1072
1197
|
|
|
1073
1198
|
Resolves a handle key into a CSS class name.
|
|
1074
1199
|
|
|
@@ -1089,7 +1214,7 @@ Resolves a handle key into a CSS class name.
|
|
|
1089
1214
|
cssVar(key): `--${string}`;
|
|
1090
1215
|
```
|
|
1091
1216
|
|
|
1092
|
-
Defined in: [names.ts:20](https://github.com/elastic/distillate/blob/
|
|
1217
|
+
Defined in: [names.ts:20](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/names.ts#L20)
|
|
1093
1218
|
|
|
1094
1219
|
Resolves a variable key into a custom property name.
|
|
1095
1220
|
|
|
@@ -1109,7 +1234,7 @@ Resolves a variable key into a custom property name.
|
|
|
1109
1234
|
cssVarRef(key): `var(--${string})`;
|
|
1110
1235
|
```
|
|
1111
1236
|
|
|
1112
|
-
Defined in: [names.ts:22](https://github.com/elastic/distillate/blob/
|
|
1237
|
+
Defined in: [names.ts:22](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/names.ts#L22)
|
|
1113
1238
|
|
|
1114
1239
|
Resolves a variable key into a `var(...)` reference.
|
|
1115
1240
|
|
|
@@ -1127,7 +1252,7 @@ Resolves a variable key into a `var(...)` reference.
|
|
|
1127
1252
|
|
|
1128
1253
|
### StyleNameResolverOptions [#stylenameresolveroptions]
|
|
1129
1254
|
|
|
1130
|
-
Defined in: [names.ts:26](https://github.com/elastic/distillate/blob/
|
|
1255
|
+
Defined in: [names.ts:26](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/names.ts#L26)
|
|
1131
1256
|
|
|
1132
1257
|
Inputs for [createStyleNameResolver](#createstylenameresolver).
|
|
1133
1258
|
|
|
@@ -1135,16 +1260,46 @@ Inputs for [createStyleNameResolver](#createstylenameresolver).
|
|
|
1135
1260
|
|
|
1136
1261
|
| Property | Type | Description | Defined in |
|
|
1137
1262
|
| ------ | ------ | ------ | ------ |
|
|
1138
|
-
| $$$classkeys-1$$$ `classKeys?` | `Iterable`\<`string`, `any`, `any`\> | Keys defining the compact class-name domain. | [names.ts:32](https://github.com/elastic/distillate/blob/
|
|
1139
|
-
| $$$cssvarkeys-1$$$ `cssVarKeys?` | `Iterable`\<`string`, `any`, `any`\> | Keys defining the compact custom-property domain. | [names.ts:34](https://github.com/elastic/distillate/blob/
|
|
1140
|
-
| $$$names-2$$$ `names` | [`StyleNameMode`](#stylenamemode) | Naming strategy (`compact` or `readable`). | [names.ts:28](https://github.com/elastic/distillate/blob/
|
|
1141
|
-
| $$$prefix-3$$$ `prefix` | `string` | Brand prefix for readable names (`<prefix>-<key>` / `--<prefix>-<key>`), e.g. `'aui'`. | [names.ts:30](https://github.com/elastic/distillate/blob/
|
|
1263
|
+
| $$$classkeys-1$$$ `classKeys?` | `Iterable`\<`string`, `any`, `any`\> | Keys defining the compact class-name domain. | [names.ts:32](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/names.ts#L32) |
|
|
1264
|
+
| $$$cssvarkeys-1$$$ `cssVarKeys?` | `Iterable`\<`string`, `any`, `any`\> | Keys defining the compact custom-property domain. | [names.ts:34](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/names.ts#L34) |
|
|
1265
|
+
| $$$names-2$$$ `names` | [`StyleNameMode`](#stylenamemode) | Naming strategy (`compact` or `readable`). | [names.ts:28](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/names.ts#L28) |
|
|
1266
|
+
| $$$prefix-3$$$ `prefix` | `string` | Brand prefix for readable names (`<prefix>-<key>` / `--<prefix>-<key>`), e.g. `'aui'`. | [names.ts:30](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/names.ts#L30) |
|
|
1267
|
+
|
|
1268
|
+
***
|
|
1269
|
+
|
|
1270
|
+
### StyleParentLike [#styleparentlike]
|
|
1271
|
+
|
|
1272
|
+
Defined in: [sink.ts:21](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/sink.ts#L21)
|
|
1273
|
+
|
|
1274
|
+
Node that receives a managed `<style>` element, e.g. `document.head` or a `ShadowRoot`.
|
|
1275
|
+
|
|
1276
|
+
#### Methods
|
|
1277
|
+
|
|
1278
|
+
##### appendChild() [#appendchild]
|
|
1279
|
+
|
|
1280
|
+
```ts
|
|
1281
|
+
appendChild(node): void;
|
|
1282
|
+
```
|
|
1283
|
+
|
|
1284
|
+
Defined in: [sink.ts:24](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/sink.ts#L24)
|
|
1285
|
+
|
|
1286
|
+
Appends the managed style element.
|
|
1287
|
+
|
|
1288
|
+
###### Parameters
|
|
1289
|
+
|
|
1290
|
+
| Parameter | Type |
|
|
1291
|
+
| ------ | ------ |
|
|
1292
|
+
| `node` | [`StyleElementLike`](#styleelementlike) |
|
|
1293
|
+
|
|
1294
|
+
###### Returns
|
|
1295
|
+
|
|
1296
|
+
`void`
|
|
1142
1297
|
|
|
1143
1298
|
***
|
|
1144
1299
|
|
|
1145
1300
|
### StyleRegistrySnapshot [#styleregistrysnapshot]
|
|
1146
1301
|
|
|
1147
|
-
Defined in: [styles/types.ts:198](https://github.com/elastic/distillate/blob/
|
|
1302
|
+
Defined in: [styles/types.ts:198](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L198)
|
|
1148
1303
|
|
|
1149
1304
|
Class and CSS-var key snapshot used to build a [StyleNameResolver](#stylenameresolver).
|
|
1150
1305
|
|
|
@@ -1152,14 +1307,14 @@ Class and CSS-var key snapshot used to build a [StyleNameResolver](#stylenameres
|
|
|
1152
1307
|
|
|
1153
1308
|
| Property | Modifier | Type | Description | Defined in |
|
|
1154
1309
|
| ------ | ------ | ------ | ------ | ------ |
|
|
1155
|
-
| $$$classkeys-2$$$ `classKeys` | `readonly` | readonly `string`[] | Collected readable class names from registered modules. | [styles/types.ts:200](https://github.com/elastic/distillate/blob/
|
|
1156
|
-
| $$$cssvarkeys-2$$$ `cssVarKeys` | `readonly` | readonly `string`[] | Collected custom property (CSS variable) keys. | [styles/types.ts:202](https://github.com/elastic/distillate/blob/
|
|
1310
|
+
| $$$classkeys-2$$$ `classKeys` | `readonly` | readonly `string`[] | Collected readable class names from registered modules. | [styles/types.ts:200](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L200) |
|
|
1311
|
+
| $$$cssvarkeys-2$$$ `cssVarKeys` | `readonly` | readonly `string`[] | Collected custom property (CSS variable) keys. | [styles/types.ts:202](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L202) |
|
|
1157
1312
|
|
|
1158
1313
|
***
|
|
1159
1314
|
|
|
1160
1315
|
### StyleRule [#stylerule]
|
|
1161
1316
|
|
|
1162
|
-
Defined in: [styles/types.ts:128](https://github.com/elastic/distillate/blob/
|
|
1317
|
+
Defined in: [styles/types.ts:128](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L128)
|
|
1163
1318
|
|
|
1164
1319
|
A selector plus declarations, optionally auto-collected from handle deps.
|
|
1165
1320
|
|
|
@@ -1167,20 +1322,20 @@ A selector plus declarations, optionally auto-collected from handle deps.
|
|
|
1167
1322
|
|
|
1168
1323
|
| Property | Modifier | Type | Description | Defined in |
|
|
1169
1324
|
| ------ | ------ | ------ | ------ | ------ |
|
|
1170
|
-
| $$$auto-1$$$ `auto` | `readonly` | `boolean` | When `false`, skip auto-collection; the caller must `use` the rule. | [styles/types.ts:144](https://github.com/elastic/distillate/blob/
|
|
1171
|
-
| $$$declarations-2$$$ `declarations` | `readonly` | [`Declarations`](#declarations) | CSS properties for this rule. | [styles/types.ts:138](https://github.com/elastic/distillate/blob/
|
|
1172
|
-
| $$$dependson$$$ `dependsOn` | `readonly` | `ReadonlySet`\<`string`\> | Handle keys this selector reads. Empty until `assignEntries` fills it. | [styles/types.ts:142](https://github.com/elastic/distillate/blob/
|
|
1173
|
-
| $$$key-3$$$ `key` | `readonly` | `string` | Unique key for this rule within the module. | [styles/types.ts:134](https://github.com/elastic/distillate/blob/
|
|
1174
|
-
| $$$kind-2$$$ `kind` | `readonly` | `"rule"` | Discriminant for [StyleEntry](#styleentry). | [styles/types.ts:130](https://github.com/elastic/distillate/blob/
|
|
1175
|
-
| $$$modulename-2$$$ `moduleName` | `readonly` | `string` | The registered module name this rule belongs to. | [styles/types.ts:132](https://github.com/elastic/distillate/blob/
|
|
1176
|
-
| $$$selector$$$ `selector` | `readonly` | (`h`) => `string` | Selector string factory receiving a resolver for `&` and other handles. | [styles/types.ts:136](https://github.com/elastic/distillate/blob/
|
|
1177
|
-
| $$$variant-2$$$ `variant` | `readonly` | `boolean` | `true` when produced inside `variants(...)`. | [styles/types.ts:140](https://github.com/elastic/distillate/blob/
|
|
1325
|
+
| $$$auto-1$$$ `auto` | `readonly` | `boolean` | When `false`, skip auto-collection; the caller must `use` the rule. | [styles/types.ts:144](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L144) |
|
|
1326
|
+
| $$$declarations-2$$$ `declarations` | `readonly` | [`Declarations`](#declarations) | CSS properties for this rule. | [styles/types.ts:138](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L138) |
|
|
1327
|
+
| $$$dependson$$$ `dependsOn` | `readonly` | `ReadonlySet`\<`string`\> | Handle keys this selector reads. Empty until `assignEntries` fills it. | [styles/types.ts:142](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L142) |
|
|
1328
|
+
| $$$key-3$$$ `key` | `readonly` | `string` | Unique key for this rule within the module. | [styles/types.ts:134](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L134) |
|
|
1329
|
+
| $$$kind-2$$$ `kind` | `readonly` | `"rule"` | Discriminant for [StyleEntry](#styleentry). | [styles/types.ts:130](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L130) |
|
|
1330
|
+
| $$$modulename-2$$$ `moduleName` | `readonly` | `string` | The registered module name this rule belongs to. | [styles/types.ts:132](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L132) |
|
|
1331
|
+
| $$$selector$$$ `selector` | `readonly` | (`h`) => `string` | Selector string factory receiving a resolver for `&` and other handles. | [styles/types.ts:136](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L136) |
|
|
1332
|
+
| $$$variant-2$$$ `variant` | `readonly` | `boolean` | `true` when produced inside `variants(...)`. | [styles/types.ts:140](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L140) |
|
|
1178
1333
|
|
|
1179
1334
|
***
|
|
1180
1335
|
|
|
1181
1336
|
### StylesCollectorOptions [#stylescollectoroptions]
|
|
1182
1337
|
|
|
1183
|
-
Defined in: [collector.ts:85](https://github.com/elastic/distillate/blob/
|
|
1338
|
+
Defined in: [collector.ts:85](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L85)
|
|
1184
1339
|
|
|
1185
1340
|
Target, naming mode, registry, and prefix for one [StylesCollector](#stylescollector).
|
|
1186
1341
|
|
|
@@ -1188,18 +1343,48 @@ Target, naming mode, registry, and prefix for one [StylesCollector](#stylescolle
|
|
|
1188
1343
|
|
|
1189
1344
|
| Property | Type | Description | Defined in |
|
|
1190
1345
|
| ------ | ------ | ------ | ------ |
|
|
1191
|
-
| $$$dev-2$$$ `dev?` | `boolean` | When `true`, emit no-op-handle warnings through `warn`. Inherited from `createDistillery({ dev })`. | [collector.ts:95](https://github.com/elastic/distillate/blob/
|
|
1192
|
-
| $$$names-3$$$ `names` | [`StyleNameMode`](#stylenamemode) | Desired name mode (`compact` or `readable`). | [collector.ts:89](https://github.com/elastic/distillate/blob/
|
|
1193
|
-
| $$$prefix-4$$$ `prefix` | `string` | Brand prefix forwarded to the name resolver. | [collector.ts:93](https://github.com/elastic/distillate/blob/
|
|
1194
|
-
| $$$registry-2$$$ `registry` | [`StyleRegistry`](#styleregistry) | Registry modules were authored against; used for auto-collection and compact-name snapshots. | [collector.ts:91](https://github.com/elastic/distillate/blob/
|
|
1195
|
-
| $$$target-1$$$ `target` | [`StyleTarget`](#styletarget) | Target context (e.g. `artifact` or `stylesheet`). | [collector.ts:87](https://github.com/elastic/distillate/blob/
|
|
1196
|
-
| $$$warn$$$ `warn?` | (`message`) => `void` | Warning sink for no-op handles. Used only when `dev` is `true`. Defaults to `console.warn`. | [collector.ts:97](https://github.com/elastic/distillate/blob/
|
|
1346
|
+
| $$$dev-2$$$ `dev?` | `boolean` | When `true`, emit no-op-handle warnings through `warn`. Inherited from `createDistillery({ dev })`. | [collector.ts:95](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L95) |
|
|
1347
|
+
| $$$names-3$$$ `names` | [`StyleNameMode`](#stylenamemode) | Desired name mode (`compact` or `readable`). | [collector.ts:89](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L89) |
|
|
1348
|
+
| $$$prefix-4$$$ `prefix` | `string` | Brand prefix forwarded to the name resolver. | [collector.ts:93](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L93) |
|
|
1349
|
+
| $$$registry-2$$$ `registry` | [`StyleRegistry`](#styleregistry) | Registry modules were authored against; used for auto-collection and compact-name snapshots. | [collector.ts:91](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L91) |
|
|
1350
|
+
| $$$target-1$$$ `target` | [`StyleTarget`](#styletarget) | Target context (e.g. `artifact` or `stylesheet`). | [collector.ts:87](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L87) |
|
|
1351
|
+
| $$$warn-1$$$ `warn?` | (`message`) => `void` | Warning sink for no-op handles. Used only when `dev` is `true`. Defaults to `console.warn`. | [collector.ts:97](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/collector.ts#L97) |
|
|
1352
|
+
|
|
1353
|
+
***
|
|
1354
|
+
|
|
1355
|
+
### StyleSink [#stylesink]
|
|
1356
|
+
|
|
1357
|
+
Defined in: [sink.ts:9](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/sink.ts#L9)
|
|
1358
|
+
|
|
1359
|
+
Receives stylesheet invalidation from a live collection or Emotion compat modules.
|
|
1360
|
+
|
|
1361
|
+
#### Methods
|
|
1362
|
+
|
|
1363
|
+
##### invalidate() [#invalidate]
|
|
1364
|
+
|
|
1365
|
+
```ts
|
|
1366
|
+
invalidate(render): void;
|
|
1367
|
+
```
|
|
1368
|
+
|
|
1369
|
+
Defined in: [sink.ts:11](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/sink.ts#L11)
|
|
1370
|
+
|
|
1371
|
+
Marks the sink dirty. `render` produces the current stylesheet when it flushes.
|
|
1372
|
+
|
|
1373
|
+
###### Parameters
|
|
1374
|
+
|
|
1375
|
+
| Parameter | Type |
|
|
1376
|
+
| ------ | ------ |
|
|
1377
|
+
| `render` | () => `string` |
|
|
1378
|
+
|
|
1379
|
+
###### Returns
|
|
1380
|
+
|
|
1381
|
+
`void`
|
|
1197
1382
|
|
|
1198
1383
|
***
|
|
1199
1384
|
|
|
1200
1385
|
### StylesModule [#stylesmodule]
|
|
1201
1386
|
|
|
1202
|
-
Defined in: [styles/types.ts:180](https://github.com/elastic/distillate/blob/
|
|
1387
|
+
Defined in: [styles/types.ts:180](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L180)
|
|
1203
1388
|
|
|
1204
1389
|
Named handle tree plus flat entries after `createStyleModule`.
|
|
1205
1390
|
|
|
@@ -1213,18 +1398,18 @@ Named handle tree plus flat entries after `createStyleModule`.
|
|
|
1213
1398
|
|
|
1214
1399
|
| Property | Modifier | Type | Description | Defined in |
|
|
1215
1400
|
| ------ | ------ | ------ | ------ | ------ |
|
|
1216
|
-
| $$$entries$$$ `entries` | `readonly` | readonly [`StyleEntry`](#styleentry)[] | Flat list of style entries (handles, rules, media) defined in this module. | [styles/types.ts:186](https://github.com/elastic/distillate/blob/
|
|
1217
|
-
| $$$handlelist$$$ `handleList` | `readonly` | readonly [`StyleHandle`](#stylehandle)[] | Flat list of just the style handles defined in this module. | [styles/types.ts:188](https://github.com/elastic/distillate/blob/
|
|
1218
|
-
| $$$handles$$$ `handles` | `readonly` | `TStyles` | Authored tree of handles, rules, and media; variants nest as records. | [styles/types.ts:184](https://github.com/elastic/distillate/blob/
|
|
1219
|
-
| $$$name-3$$$ `name` | `readonly` | `string` | The unique registered name of the module. | [styles/types.ts:182](https://github.com/elastic/distillate/blob/
|
|
1220
|
-
| $$$themedeps$$$ `themeDeps` | `readonly` | `ReadonlySet`\<`string`\> | Aggregated theme dependencies across all entries. | [styles/types.ts:190](https://github.com/elastic/distillate/blob/
|
|
1221
|
-
| $$$vardeps$$$ `varDeps` | `readonly` | `ReadonlySet`\<`` `vars/${string}` ``\> | Aggregated variable dependencies across all entries. | [styles/types.ts:192](https://github.com/elastic/distillate/blob/
|
|
1401
|
+
| $$$entries$$$ `entries` | `readonly` | readonly [`StyleEntry`](#styleentry)[] | Flat list of style entries (handles, rules, media) defined in this module. | [styles/types.ts:186](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L186) |
|
|
1402
|
+
| $$$handlelist$$$ `handleList` | `readonly` | readonly [`StyleHandle`](#stylehandle)[] | Flat list of just the style handles defined in this module. | [styles/types.ts:188](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L188) |
|
|
1403
|
+
| $$$handles$$$ `handles` | `readonly` | `TStyles` | Authored tree of handles, rules, and media; variants nest as records. | [styles/types.ts:184](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L184) |
|
|
1404
|
+
| $$$name-3$$$ `name` | `readonly` | `string` | The unique registered name of the module. | [styles/types.ts:182](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L182) |
|
|
1405
|
+
| $$$themedeps$$$ `themeDeps` | `readonly` | `ReadonlySet`\<`string`\> | Aggregated theme dependencies across all entries. | [styles/types.ts:190](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L190) |
|
|
1406
|
+
| $$$vardeps$$$ `varDeps` | `readonly` | `ReadonlySet`\<`` `vars/${string}` ``\> | Aggregated variable dependencies across all entries. | [styles/types.ts:192](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L192) |
|
|
1222
1407
|
|
|
1223
1408
|
***
|
|
1224
1409
|
|
|
1225
1410
|
### ThemeAlternate [#themealternate]
|
|
1226
1411
|
|
|
1227
|
-
Defined in: [runtime.ts:83](https://github.com/elastic/distillate/blob/
|
|
1412
|
+
Defined in: [runtime.ts:83](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/runtime.ts#L83)
|
|
1228
1413
|
|
|
1229
1414
|
One runtime-switched variation. `selector` is required unless the variation declares `media`.
|
|
1230
1415
|
|
|
@@ -1232,14 +1417,14 @@ One runtime-switched variation. `selector` is required unless the variation decl
|
|
|
1232
1417
|
|
|
1233
1418
|
| Property | Modifier | Type | Description | Defined in |
|
|
1234
1419
|
| ------ | ------ | ------ | ------ | ------ |
|
|
1235
|
-
| $$$selector-1$$$ `selector?` | `readonly` | `string` | Consuming page selector, composed with `themeScope`. | [runtime.ts:87](https://github.com/elastic/distillate/blob/
|
|
1236
|
-
| $$$variation-1$$$ `variation` | `readonly` | `string` | Name passed in `DistilleryOptions.variations`. | [runtime.ts:85](https://github.com/elastic/distillate/blob/
|
|
1420
|
+
| $$$selector-1$$$ `selector?` | `readonly` | `string` | Consuming page selector, composed with `themeScope`. | [runtime.ts:87](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/runtime.ts#L87) |
|
|
1421
|
+
| $$$variation-1$$$ `variation` | `readonly` | `string` | Name passed in `DistilleryOptions.variations`. | [runtime.ts:85](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/runtime.ts#L85) |
|
|
1237
1422
|
|
|
1238
1423
|
***
|
|
1239
1424
|
|
|
1240
1425
|
### ThemeVarDefinition [#themevardefinition]
|
|
1241
1426
|
|
|
1242
|
-
Defined in: [environment.ts:15](https://github.com/elastic/distillate/blob/
|
|
1427
|
+
Defined in: [environment.ts:15](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L15)
|
|
1243
1428
|
|
|
1244
1429
|
One theme CSS variable. Differing `light`/`dark` fold into `light-dark(...)`.
|
|
1245
1430
|
|
|
@@ -1247,10 +1432,10 @@ One theme CSS variable. Differing `light`/`dark` fold into `light-dark(...)`.
|
|
|
1247
1432
|
|
|
1248
1433
|
| Property | Modifier | Type | Description | Defined in |
|
|
1249
1434
|
| ------ | ------ | ------ | ------ | ------ |
|
|
1250
|
-
| $$$cssvar-2$$$ `cssVar` | `readonly` | `` `--${string}` `` | Emitted CSS custom property name. Equal to `cssVarName(prefix, path)`. | [environment.ts:19](https://github.com/elastic/distillate/blob/
|
|
1251
|
-
| $$$dark-1$$$ `dark` | `readonly` | `string` | Value for dark color scheme. Equal to `light` for scheme-invariant tokens. | [environment.ts:23](https://github.com/elastic/distillate/blob/
|
|
1252
|
-
| $$$light-1$$$ `light` | `readonly` | `string` | Value for light color scheme. | [environment.ts:21](https://github.com/elastic/distillate/blob/
|
|
1253
|
-
| $$$path-5$$$ `path` | `readonly` | `string` | Theme-tree path this definition was derived from. | [environment.ts:17](https://github.com/elastic/distillate/blob/
|
|
1435
|
+
| $$$cssvar-2$$$ `cssVar` | `readonly` | `` `--${string}` `` | Emitted CSS custom property name. Equal to `cssVarName(prefix, path)`. | [environment.ts:19](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L19) |
|
|
1436
|
+
| $$$dark-1$$$ `dark` | `readonly` | `string` | Value for dark color scheme. Equal to `light` for scheme-invariant tokens. | [environment.ts:23](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L23) |
|
|
1437
|
+
| $$$light-1$$$ `light` | `readonly` | `string` | Value for light color scheme. | [environment.ts:21](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L21) |
|
|
1438
|
+
| $$$path-5$$$ `path` | `readonly` | `string` | Theme-tree path this definition was derived from. | [environment.ts:17](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/environment.ts#L17) |
|
|
1254
1439
|
|
|
1255
1440
|
## Type Aliases
|
|
1256
1441
|
|
|
@@ -1260,7 +1445,7 @@ One theme CSS variable. Differing `light`/`dark` fold into `light-dark(...)`.
|
|
|
1260
1445
|
type ContextualVarPath = `vars/${string}`;
|
|
1261
1446
|
```
|
|
1262
1447
|
|
|
1263
|
-
Defined in: [styles/types.ts:32](https://github.com/elastic/distillate/blob/
|
|
1448
|
+
Defined in: [styles/types.ts:32](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L32)
|
|
1264
1449
|
|
|
1265
1450
|
Canonical `vars/<group>/<key>` path for a contextual or module-local CSS variable.
|
|
1266
1451
|
|
|
@@ -1279,7 +1464,7 @@ type CssValue =
|
|
|
1279
1464
|
| LocalVarRef;
|
|
1280
1465
|
```
|
|
1281
1466
|
|
|
1282
|
-
Defined in: [styles/types.ts:37](https://github.com/elastic/distillate/blob/
|
|
1467
|
+
Defined in: [styles/types.ts:37](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L37)
|
|
1283
1468
|
|
|
1284
1469
|
Values accepted by `t.vars(...)` defaults and `.set(...)`.
|
|
1285
1470
|
|
|
@@ -1291,7 +1476,7 @@ Values accepted by `t.vars(...)` defaults and `.set(...)`.
|
|
|
1291
1476
|
type CssVarPath = string;
|
|
1292
1477
|
```
|
|
1293
1478
|
|
|
1294
|
-
Defined in: [styles/types.ts:34](https://github.com/elastic/distillate/blob/
|
|
1479
|
+
Defined in: [styles/types.ts:34](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L34)
|
|
1295
1480
|
|
|
1296
1481
|
Theme-token path or any other CSS-var key the resolver knows.
|
|
1297
1482
|
|
|
@@ -1303,7 +1488,7 @@ Theme-token path or any other CSS-var key the resolver knows.
|
|
|
1303
1488
|
type DeclarationSegment = string | LocalVarMarker;
|
|
1304
1489
|
```
|
|
1305
1490
|
|
|
1306
|
-
Defined in: [styles/types.ts:94](https://github.com/elastic/distillate/blob/
|
|
1491
|
+
Defined in: [styles/types.ts:94](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L94)
|
|
1307
1492
|
|
|
1308
1493
|
Literal CSS text or a local-var interpolation marker.
|
|
1309
1494
|
|
|
@@ -1315,7 +1500,7 @@ Literal CSS text or a local-var interpolation marker.
|
|
|
1315
1500
|
type DeepPartialTheme<T> = T extends ScaleToken ? ScaleToken : T extends SchemePair | string ? string | SchemePair : T extends object ? { readonly [K in keyof T]?: DeepPartialTheme<T[K]> } : never;
|
|
1316
1501
|
```
|
|
1317
1502
|
|
|
1318
|
-
Defined in: [theme.ts:80](https://github.com/elastic/distillate/blob/
|
|
1503
|
+
Defined in: [theme.ts:80](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L80)
|
|
1319
1504
|
|
|
1320
1505
|
Partial variation of a [ThemeTree](#themetree). Leaves may change kind between `string` and [SchemePair](#schemepair).
|
|
1321
1506
|
|
|
@@ -1333,7 +1518,7 @@ Partial variation of a [ThemeTree](#themetree). Leaves may change kind between `
|
|
|
1333
1518
|
type LocalVarGroup<TKey> = { readonly [P in TKey]: LocalVarRef } & object;
|
|
1334
1519
|
```
|
|
1335
1520
|
|
|
1336
|
-
Defined in: [local\_vars.ts:79](https://github.com/elastic/distillate/blob/
|
|
1521
|
+
Defined in: [local\_vars.ts:79](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L79)
|
|
1337
1522
|
|
|
1338
1523
|
Value returned by `t.vars(...)`. Interpolate `${group}`, `${group.key}`, or `${group.set({...})}`.
|
|
1339
1524
|
|
|
@@ -1373,7 +1558,7 @@ type LocalVarMarker =
|
|
|
1373
1558
|
| LocalVarDefaultMarker;
|
|
1374
1559
|
```
|
|
1375
1560
|
|
|
1376
|
-
Defined in: [local\_vars.ts:74](https://github.com/elastic/distillate/blob/
|
|
1561
|
+
Defined in: [local\_vars.ts:74](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/local_vars.ts#L74)
|
|
1377
1562
|
|
|
1378
1563
|
Interpolation marker: `${group}` defaults or `${group.set(...)}` overrides.
|
|
1379
1564
|
|
|
@@ -1385,7 +1570,7 @@ Interpolation marker: `${group}` defaults or `${group.set(...)}` overrides.
|
|
|
1385
1570
|
type PathsOf<T, Prefix> = T extends ScaleToken ? never : T extends SchemePair | string ? Prefix extends "" ? never : Prefix : T extends object ? { [K in keyof T & string]: PathsOf<T[K], Prefix extends "" ? K : `${Prefix}/${K}`> }[keyof T & string] : never;
|
|
1386
1571
|
```
|
|
1387
1572
|
|
|
1388
|
-
Defined in: [theme.ts:55](https://github.com/elastic/distillate/blob/
|
|
1573
|
+
Defined in: [theme.ts:55](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L55)
|
|
1389
1574
|
|
|
1390
1575
|
Slash-delimited theme-var paths (excludes [ScaleToken](#scaletoken) leaves).
|
|
1391
1576
|
|
|
@@ -1404,7 +1589,7 @@ Slash-delimited theme-var paths (excludes [ScaleToken](#scaletoken) leaves).
|
|
|
1404
1589
|
type ResolvedStyles<TValue> = TValue extends PendingStyleHandle ? StyleHandle : TValue extends StyleRule ? StyleRule : TValue extends StyleMedia ? StyleMedia : TValue extends readonly infer TItem[] ? readonly ResolvedStyles<TItem>[] : TValue extends Record<string, unknown> ? { [TKey in keyof TValue]: ResolvedStyles<TValue[TKey]> } : TValue;
|
|
1405
1590
|
```
|
|
1406
1591
|
|
|
1407
|
-
Defined in: [styles/types.ts:206](https://github.com/elastic/distillate/blob/
|
|
1592
|
+
Defined in: [styles/types.ts:206](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L206)
|
|
1408
1593
|
|
|
1409
1594
|
Resolves nested pending handles, rules, and medias into their runtime types.
|
|
1410
1595
|
|
|
@@ -1422,7 +1607,7 @@ Resolves nested pending handles, rules, and medias into their runtime types.
|
|
|
1422
1607
|
type SchemeValueTree = object;
|
|
1423
1608
|
```
|
|
1424
1609
|
|
|
1425
|
-
Defined in: [theme.ts:32](https://github.com/elastic/distillate/blob/
|
|
1610
|
+
Defined in: [theme.ts:32](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L32)
|
|
1426
1611
|
|
|
1427
1612
|
Per-scheme value tree accepted by [zipSchemes](#zipschemes).
|
|
1428
1613
|
|
|
@@ -1446,7 +1631,7 @@ type StyleEntry =
|
|
|
1446
1631
|
| StyleMedia;
|
|
1447
1632
|
```
|
|
1448
1633
|
|
|
1449
|
-
Defined in: [styles/types.ts:174](https://github.com/elastic/distillate/blob/
|
|
1634
|
+
Defined in: [styles/types.ts:174](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L174)
|
|
1450
1635
|
|
|
1451
1636
|
One registered handle, selector rule, or at-rule block.
|
|
1452
1637
|
|
|
@@ -1458,7 +1643,7 @@ One registered handle, selector rule, or at-rule block.
|
|
|
1458
1643
|
type StyleNameMode = "compact" | "readable";
|
|
1459
1644
|
```
|
|
1460
1645
|
|
|
1461
|
-
Defined in: [names.ts:9](https://github.com/elastic/distillate/blob/
|
|
1646
|
+
Defined in: [names.ts:9](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/names.ts#L9)
|
|
1462
1647
|
|
|
1463
1648
|
Naming scheme: `compact` assigns sequential identifiers by sorted key index, `readable` emits descriptive ones.
|
|
1464
1649
|
|
|
@@ -1470,7 +1655,7 @@ Naming scheme: `compact` assigns sequential identifiers by sorted key index, `re
|
|
|
1470
1655
|
type StyleSelectorResolver = (handle) => string & Record<string, string>;
|
|
1471
1656
|
```
|
|
1472
1657
|
|
|
1473
|
-
Defined in: [styles/types.ts:176](https://github.com/elastic/distillate/blob/
|
|
1658
|
+
Defined in: [styles/types.ts:176](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L176)
|
|
1474
1659
|
|
|
1475
1660
|
Selector factory: call with a handle, or read sibling local names as `.class` strings.
|
|
1476
1661
|
|
|
@@ -1482,7 +1667,7 @@ Selector factory: call with a handle, or read sibling local names as `.class` st
|
|
|
1482
1667
|
type StylesObject = Record<string, unknown>;
|
|
1483
1668
|
```
|
|
1484
1669
|
|
|
1485
|
-
Defined in: [styles/types.ts:196](https://github.com/elastic/distillate/blob/
|
|
1670
|
+
Defined in: [styles/types.ts:196](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L196)
|
|
1486
1671
|
|
|
1487
1672
|
Authored module tree before [ResolvedStyles](#resolvedstyles) substitution.
|
|
1488
1673
|
|
|
@@ -1494,7 +1679,7 @@ Authored module tree before [ResolvedStyles](#resolvedstyles) substitution.
|
|
|
1494
1679
|
type StyleTarget = "artifact" | "stylesheet";
|
|
1495
1680
|
```
|
|
1496
1681
|
|
|
1497
|
-
Defined in: [names.ts:11](https://github.com/elastic/distillate/blob/
|
|
1682
|
+
Defined in: [names.ts:11](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/names.ts#L11)
|
|
1498
1683
|
|
|
1499
1684
|
Destination format for the CSS collection.
|
|
1500
1685
|
|
|
@@ -1506,7 +1691,7 @@ Destination format for the CSS collection.
|
|
|
1506
1691
|
type ThemeTree = object;
|
|
1507
1692
|
```
|
|
1508
1693
|
|
|
1509
|
-
Defined in: [theme.ts:27](https://github.com/elastic/distillate/blob/
|
|
1694
|
+
Defined in: [theme.ts:27](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L27)
|
|
1510
1695
|
|
|
1511
1696
|
Nested authoring tree. Keys must match `/^[A-Za-z_][A-Za-z0-9_]*$/`.
|
|
1512
1697
|
|
|
@@ -1526,7 +1711,7 @@ type ThemeVariation<T> =
|
|
|
1526
1711
|
| MediaThemeVariation<T>;
|
|
1527
1712
|
```
|
|
1528
1713
|
|
|
1529
|
-
Defined in: [theme.ts:97](https://github.com/elastic/distillate/blob/
|
|
1714
|
+
Defined in: [theme.ts:97](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L97)
|
|
1530
1715
|
|
|
1531
1716
|
Named variation: a partial of the base, or a media-conditioned partial.
|
|
1532
1717
|
|
|
@@ -1544,7 +1729,7 @@ Named variation: a partial of the base, or a media-conditioned partial.
|
|
|
1544
1729
|
type TokensOf<T> = T extends ScaleToken ? ScaleToken : T extends SchemePair | string ? CssToken : T extends object ? { readonly [K in keyof T]: TokensOf<T[K]> } : never;
|
|
1545
1730
|
```
|
|
1546
1731
|
|
|
1547
|
-
Defined in: [theme.ts:37](https://github.com/elastic/distillate/blob/
|
|
1732
|
+
Defined in: [theme.ts:37](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L37)
|
|
1548
1733
|
|
|
1549
1734
|
Token tree derived from an authoring [ThemeTree](#themetree).
|
|
1550
1735
|
|
|
@@ -1562,7 +1747,7 @@ Token tree derived from an authoring [ThemeTree](#themetree).
|
|
|
1562
1747
|
type ValuesOf<T> = T extends ScaleToken ? string : T extends SchemePair | string ? string : T extends object ? { readonly [K in keyof T]: ValuesOf<T[K]> } : never;
|
|
1563
1748
|
```
|
|
1564
1749
|
|
|
1565
|
-
Defined in: [theme.ts:46](https://github.com/elastic/distillate/blob/
|
|
1750
|
+
Defined in: [theme.ts:46](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L46)
|
|
1566
1751
|
|
|
1567
1752
|
Literal-value tree for one scheme. [ScaleToken](#scaletoken) leaves use `.value`.
|
|
1568
1753
|
|
|
@@ -1580,7 +1765,7 @@ Literal-value tree for one scheme. [ScaleToken](#scaletoken) leaves use `.value`
|
|
|
1580
1765
|
type Zipped<T> = T extends ScaleToken ? ScaleToken : T extends string ? string | SchemePair : T extends object ? { readonly [K in keyof T]: Zipped<T[K]> } : never;
|
|
1581
1766
|
```
|
|
1582
1767
|
|
|
1583
|
-
Defined in: [theme.ts:71](https://github.com/elastic/distillate/blob/
|
|
1768
|
+
Defined in: [theme.ts:71](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L71)
|
|
1584
1769
|
|
|
1585
1770
|
[zipSchemes](#zipschemes) output: equal strings collapse; differing strings become [SchemePair](#schemepair).
|
|
1586
1771
|
|
|
@@ -1598,7 +1783,7 @@ Defined in: [theme.ts:71](https://github.com/elastic/distillate/blob/f131912edad
|
|
|
1598
1783
|
const cq: (value, cq) => ScaleToken = scaleToken;
|
|
1599
1784
|
```
|
|
1600
1785
|
|
|
1601
|
-
Defined in: [tokens/scale\_token.ts:37](https://github.com/elastic/distillate/blob/
|
|
1786
|
+
Defined in: [tokens/scale\_token.ts:37](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/scale_token.ts#L37)
|
|
1602
1787
|
|
|
1603
1788
|
Alias of [scaleToken](#scaletoken-1) for theme-tree authoring.
|
|
1604
1789
|
|
|
@@ -1623,7 +1808,7 @@ Literal size token. Stringifies to `value`; `cq` is the container-relative varia
|
|
|
1623
1808
|
function combineClassNames(context, ...handles): string;
|
|
1624
1809
|
```
|
|
1625
1810
|
|
|
1626
|
-
Defined in: [styles/authoring.ts:203](https://github.com/elastic/distillate/blob/
|
|
1811
|
+
Defined in: [styles/authoring.ts:203](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/authoring.ts#L203)
|
|
1627
1812
|
|
|
1628
1813
|
Resolves handles through the collector's class-name resolver.
|
|
1629
1814
|
|
|
@@ -1647,7 +1832,7 @@ Resolves handles through the collector's class-name resolver.
|
|
|
1647
1832
|
function container(query, rules): StyleMedia;
|
|
1648
1833
|
```
|
|
1649
1834
|
|
|
1650
|
-
Defined in: [styles/authoring.ts:140](https://github.com/elastic/distillate/blob/
|
|
1835
|
+
Defined in: [styles/authoring.ts:140](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/authoring.ts#L140)
|
|
1651
1836
|
|
|
1652
1837
|
`@container` block. `kind` stays `'media'` so emission rank matches [media](#media-2).
|
|
1653
1838
|
|
|
@@ -1670,7 +1855,7 @@ Defined in: [styles/authoring.ts:140](https://github.com/elastic/distillate/blob
|
|
|
1670
1855
|
function contextualVar(path, prop): ContextualCssVar;
|
|
1671
1856
|
```
|
|
1672
1857
|
|
|
1673
|
-
Defined in: [tokens/contextual\_var.ts:41](https://github.com/elastic/distillate/blob/
|
|
1858
|
+
Defined in: [tokens/contextual\_var.ts:41](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L41)
|
|
1674
1859
|
|
|
1675
1860
|
Shared contextual var. Stringifies to `var(<prop>)`; `.name` is the ident.
|
|
1676
1861
|
|
|
@@ -1693,7 +1878,7 @@ Shared contextual var. Stringifies to `var(<prop>)`; `.name` is the ident.
|
|
|
1693
1878
|
function createDistillery<TTheme>(options): Distillery<TokensOf<TTheme>, TTheme>;
|
|
1694
1879
|
```
|
|
1695
1880
|
|
|
1696
|
-
Defined in: [engine.ts:
|
|
1881
|
+
Defined in: [engine.ts:128](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/engine.ts#L128)
|
|
1697
1882
|
|
|
1698
1883
|
Binds the engine to one library's prefix and theme tree.
|
|
1699
1884
|
|
|
@@ -1719,13 +1904,35 @@ If `prefix` is not a CSS identifier segment, if a theme key contains a hyphen, i
|
|
|
1719
1904
|
|
|
1720
1905
|
***
|
|
1721
1906
|
|
|
1907
|
+
### createDomSink() [#createdomsink]
|
|
1908
|
+
|
|
1909
|
+
```ts
|
|
1910
|
+
function createDomSink(__namedParameters): StyleSink;
|
|
1911
|
+
```
|
|
1912
|
+
|
|
1913
|
+
Defined in: [dom\_sink.ts:33](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/dom_sink.ts#L33)
|
|
1914
|
+
|
|
1915
|
+
One managed `<style>` element, rewritten on each flush.
|
|
1916
|
+
|
|
1917
|
+
#### Parameters
|
|
1918
|
+
|
|
1919
|
+
| Parameter | Type |
|
|
1920
|
+
| ------ | ------ |
|
|
1921
|
+
| `__namedParameters` | [`CreateDomSinkOptions`](#createdomsinkoptions) |
|
|
1922
|
+
|
|
1923
|
+
#### Returns
|
|
1924
|
+
|
|
1925
|
+
[`StyleSink`](#stylesink)
|
|
1926
|
+
|
|
1927
|
+
***
|
|
1928
|
+
|
|
1722
1929
|
### createStyleNameResolver() [#createstylenameresolver]
|
|
1723
1930
|
|
|
1724
1931
|
```ts
|
|
1725
1932
|
function createStyleNameResolver(__namedParameters): StyleNameResolver;
|
|
1726
1933
|
```
|
|
1727
1934
|
|
|
1728
|
-
Defined in: [names.ts:102](https://github.com/elastic/distillate/blob/
|
|
1935
|
+
Defined in: [names.ts:102](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/names.ts#L102)
|
|
1729
1936
|
|
|
1730
1937
|
Maps semantic keys to readable (`<prefix>-<key>`) or compact (`a`, `b`, …) names.
|
|
1731
1938
|
|
|
@@ -1741,13 +1948,13 @@ Maps semantic keys to readable (`<prefix>-<key>`) or compact (`a`, `b`, …) nam
|
|
|
1741
1948
|
|
|
1742
1949
|
***
|
|
1743
1950
|
|
|
1744
|
-
### css() [#css-
|
|
1951
|
+
### css() [#css-3]
|
|
1745
1952
|
|
|
1746
1953
|
```ts
|
|
1747
1954
|
function css(strings, ...values): PendingStyleHandle;
|
|
1748
1955
|
```
|
|
1749
1956
|
|
|
1750
|
-
Defined in: [styles/authoring.ts:37](https://github.com/elastic/distillate/blob/
|
|
1957
|
+
Defined in: [styles/authoring.ts:37](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/authoring.ts#L37)
|
|
1751
1958
|
|
|
1752
1959
|
Handle template. Nested `&` / `@media` flatten into sibling rules.
|
|
1753
1960
|
|
|
@@ -1770,7 +1977,7 @@ Handle template. Nested `&` / `@media` flatten into sibling rules.
|
|
|
1770
1977
|
function cssVarName(prefix, path): `--${string}`;
|
|
1771
1978
|
```
|
|
1772
1979
|
|
|
1773
|
-
Defined in: [names.ts:86](https://github.com/elastic/distillate/blob/
|
|
1980
|
+
Defined in: [names.ts:86](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/names.ts#L86)
|
|
1774
1981
|
|
|
1775
1982
|
Readable custom-property name: `--${prefix}-${path}` with `/` joined on `-` and a leading `vars/` stripped.
|
|
1776
1983
|
|
|
@@ -1793,7 +2000,7 @@ Readable custom-property name: `--${prefix}-${path}` with `/` joined on `-` and
|
|
|
1793
2000
|
function decls(strings, ...values): Declarations;
|
|
1794
2001
|
```
|
|
1795
2002
|
|
|
1796
|
-
Defined in: [styles/authoring.ts:31](https://github.com/elastic/distillate/blob/
|
|
2003
|
+
Defined in: [styles/authoring.ts:31](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/authoring.ts#L31)
|
|
1797
2004
|
|
|
1798
2005
|
Declaration-block template. Interpolations stringify; local-var markers stay until render.
|
|
1799
2006
|
|
|
@@ -1816,7 +2023,7 @@ Declaration-block template. Interpolations stringify; local-var markers stay unt
|
|
|
1816
2023
|
function isContextualCssVar(value): value is ContextualCssVar;
|
|
1817
2024
|
```
|
|
1818
2025
|
|
|
1819
|
-
Defined in: [tokens/contextual\_var.ts:66](https://github.com/elastic/distillate/blob/
|
|
2026
|
+
Defined in: [tokens/contextual\_var.ts:66](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L66)
|
|
1820
2027
|
|
|
1821
2028
|
`true` when `value` is a [ContextualCssVar](#contextualcssvar).
|
|
1822
2029
|
|
|
@@ -1838,7 +2045,7 @@ Defined in: [tokens/contextual\_var.ts:66](https://github.com/elastic/distillate
|
|
|
1838
2045
|
function isContextualCssVarName(value): value is ContextualCssVarName;
|
|
1839
2046
|
```
|
|
1840
2047
|
|
|
1841
|
-
Defined in: [tokens/contextual\_var.ts:70](https://github.com/elastic/distillate/blob/
|
|
2048
|
+
Defined in: [tokens/contextual\_var.ts:70](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/contextual_var.ts#L70)
|
|
1842
2049
|
|
|
1843
2050
|
`true` when `value` is a [ContextualCssVarName](#contextualcssvarname-1).
|
|
1844
2051
|
|
|
@@ -1860,7 +2067,7 @@ Defined in: [tokens/contextual\_var.ts:70](https://github.com/elastic/distillate
|
|
|
1860
2067
|
function isCssToken(value): value is CssToken;
|
|
1861
2068
|
```
|
|
1862
2069
|
|
|
1863
|
-
Defined in: [tokens/theme\_token.ts:41](https://github.com/elastic/distillate/blob/
|
|
2070
|
+
Defined in: [tokens/theme\_token.ts:41](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/theme_token.ts#L41)
|
|
1864
2071
|
|
|
1865
2072
|
`true` when `value` is a [CssToken](#csstoken).
|
|
1866
2073
|
|
|
@@ -1882,7 +2089,7 @@ Defined in: [tokens/theme\_token.ts:41](https://github.com/elastic/distillate/bl
|
|
|
1882
2089
|
function isScaleToken(value): value is ScaleToken;
|
|
1883
2090
|
```
|
|
1884
2091
|
|
|
1885
|
-
Defined in: [tokens/scale\_token.ts:40](https://github.com/elastic/distillate/blob/
|
|
2092
|
+
Defined in: [tokens/scale\_token.ts:40](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/scale_token.ts#L40)
|
|
1886
2093
|
|
|
1887
2094
|
`true` when `value` is a [ScaleToken](#scaletoken).
|
|
1888
2095
|
|
|
@@ -1904,7 +2111,7 @@ Defined in: [tokens/scale\_token.ts:40](https://github.com/elastic/distillate/bl
|
|
|
1904
2111
|
function lightDark(light, dark): SchemePair;
|
|
1905
2112
|
```
|
|
1906
2113
|
|
|
1907
|
-
Defined in: [tokens/light\_dark.ts:31](https://github.com/elastic/distillate/blob/
|
|
2114
|
+
Defined in: [tokens/light\_dark.ts:31](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/light_dark.ts#L31)
|
|
1908
2115
|
|
|
1909
2116
|
Scheme-varying color pair. Both sides must be CSS `<color>` values.
|
|
1910
2117
|
|
|
@@ -1931,7 +2138,7 @@ If either value is not a CSS `<color>`.
|
|
|
1931
2138
|
function mapDomain<TKey, TValue>(domain, factory): Record<TKey, TValue>;
|
|
1932
2139
|
```
|
|
1933
2140
|
|
|
1934
|
-
Defined in: [styles/authoring.ts:171](https://github.com/elastic/distillate/blob/
|
|
2141
|
+
Defined in: [styles/authoring.ts:171](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/authoring.ts#L171)
|
|
1935
2142
|
|
|
1936
2143
|
Builds a record keyed by `domain`. No CSS-collection side effect.
|
|
1937
2144
|
|
|
@@ -1961,7 +2168,7 @@ Builds a record keyed by `domain`. No CSS-collection side effect.
|
|
|
1961
2168
|
function media(query, rules): StyleMedia;
|
|
1962
2169
|
```
|
|
1963
2170
|
|
|
1964
|
-
Defined in: [styles/authoring.ts:121](https://github.com/elastic/distillate/blob/
|
|
2171
|
+
Defined in: [styles/authoring.ts:121](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/authoring.ts#L121)
|
|
1965
2172
|
|
|
1966
2173
|
`@media` block wrapping rules.
|
|
1967
2174
|
|
|
@@ -1989,7 +2196,7 @@ function renderStyles(
|
|
|
1989
2196
|
): string;
|
|
1990
2197
|
```
|
|
1991
2198
|
|
|
1992
|
-
Defined in: [runtime.ts:39](https://github.com/elastic/distillate/blob/
|
|
2199
|
+
Defined in: [runtime.ts:39](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/runtime.ts#L39)
|
|
1993
2200
|
|
|
1994
2201
|
Emits collected CSS: theme block, then entries, minified.
|
|
1995
2202
|
|
|
@@ -2019,7 +2226,7 @@ function resolveThemeValues<T>(
|
|
|
2019
2226
|
): ValuesOf<T>;
|
|
2020
2227
|
```
|
|
2021
2228
|
|
|
2022
|
-
Defined in: [theme.ts:142](https://github.com/elastic/distillate/blob/
|
|
2229
|
+
Defined in: [theme.ts:142](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L142)
|
|
2023
2230
|
|
|
2024
2231
|
Nested literal values for one scheme. Walks `theme` so [ScaleToken](#scaletoken) leaves resolve to `.value`.
|
|
2025
2232
|
|
|
@@ -2054,7 +2261,7 @@ function rule(
|
|
|
2054
2261
|
): StyleRule;
|
|
2055
2262
|
```
|
|
2056
2263
|
|
|
2057
|
-
Defined in: [styles/authoring.ts:97](https://github.com/elastic/distillate/blob/
|
|
2264
|
+
Defined in: [styles/authoring.ts:97](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/authoring.ts#L97)
|
|
2058
2265
|
|
|
2059
2266
|
Selector plus declarations. `dependsOn` is filled when the module is constructed.
|
|
2060
2267
|
|
|
@@ -2078,7 +2285,7 @@ Selector plus declarations. `dependsOn` is filled when the module is constructed
|
|
|
2078
2285
|
function scaleToken(value, cq): ScaleToken;
|
|
2079
2286
|
```
|
|
2080
2287
|
|
|
2081
|
-
Defined in: [tokens/scale\_token.ts:25](https://github.com/elastic/distillate/blob/
|
|
2288
|
+
Defined in: [tokens/scale\_token.ts:25](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/scale_token.ts#L25)
|
|
2082
2289
|
|
|
2083
2290
|
Literal size token. Stringifies to `value`; `cq` is the container-relative variant.
|
|
2084
2291
|
|
|
@@ -2101,7 +2308,7 @@ Literal size token. Stringifies to `value`; `cq` is the container-relative varia
|
|
|
2101
2308
|
function themeToken(path, cssVar): CssToken;
|
|
2102
2309
|
```
|
|
2103
2310
|
|
|
2104
|
-
Defined in: [tokens/theme\_token.ts:27](https://github.com/elastic/distillate/blob/
|
|
2311
|
+
Defined in: [tokens/theme\_token.ts:27](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/tokens/theme_token.ts#L27)
|
|
2105
2312
|
|
|
2106
2313
|
Theme token that stringifies to `var(<cssVar>)`.
|
|
2107
2314
|
|
|
@@ -2124,7 +2331,7 @@ Theme token that stringifies to `var(<cssVar>)`.
|
|
|
2124
2331
|
function variants<TKey, TValue>(domain, factory): Record<TKey, TValue>;
|
|
2125
2332
|
```
|
|
2126
2333
|
|
|
2127
|
-
Defined in: [styles/authoring.ts:186](https://github.com/elastic/distillate/blob/
|
|
2334
|
+
Defined in: [styles/authoring.ts:186](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/authoring.ts#L186)
|
|
2128
2335
|
|
|
2129
2336
|
Builds a record of styles keyed by `domain`. Each value is marked `variant` so [StylesCollector.use](#use) skips it.
|
|
2130
2337
|
|
|
@@ -2154,7 +2361,7 @@ Builds a record of styles keyed by `domain`. Each value is marked `variant` so [
|
|
|
2154
2361
|
function zipSchemes<T>(light, dark): Zipped<T>;
|
|
2155
2362
|
```
|
|
2156
2363
|
|
|
2157
|
-
Defined in: [theme.ts:119](https://github.com/elastic/distillate/blob/
|
|
2364
|
+
Defined in: [theme.ts:119](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/theme.ts#L119)
|
|
2158
2365
|
|
|
2159
2366
|
Folds two per-scheme trees into one authoring tree. Equal string leaves stay bare; differing strings become [lightDark](#lightdark). [ScaleToken](#scaletoken) leaves must agree.
|
|
2160
2367
|
|