@elastic/distillate 0.0.0 → 0.1.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.
Files changed (285) hide show
  1. package/LICENSE.txt +93 -0
  2. package/NOTICE.txt +30 -0
  3. package/README.md +142 -0
  4. package/THIRD_PARTY_LICENSES.md +768 -0
  5. package/dist/cjs/collector.js +420 -0
  6. package/dist/cjs/collector.js.map +1 -0
  7. package/dist/cjs/css_scan.js +186 -0
  8. package/dist/cjs/css_scan.js.map +1 -0
  9. package/dist/cjs/dom_sink.js +40 -0
  10. package/dist/cjs/dom_sink.js.map +1 -0
  11. package/dist/cjs/emotion.js +189 -0
  12. package/dist/cjs/emotion.js.map +1 -0
  13. package/dist/cjs/engine.js +79 -0
  14. package/dist/cjs/engine.js.map +1 -0
  15. package/dist/cjs/environment.js +9 -0
  16. package/dist/cjs/environment.js.map +1 -0
  17. package/dist/cjs/hash.js +86 -0
  18. package/dist/cjs/hash.js.map +1 -0
  19. package/dist/cjs/idents.js +23 -0
  20. package/dist/cjs/idents.js.map +1 -0
  21. package/dist/cjs/index.js +42 -0
  22. package/dist/cjs/index.js.map +1 -0
  23. package/dist/cjs/instance.js +34 -0
  24. package/dist/cjs/instance.js.map +1 -0
  25. package/dist/cjs/local_vars.js +100 -0
  26. package/dist/cjs/local_vars.js.map +1 -0
  27. package/dist/cjs/minify.js +77 -0
  28. package/dist/cjs/minify.js.map +1 -0
  29. package/dist/cjs/names.js +77 -0
  30. package/dist/cjs/names.js.map +1 -0
  31. package/dist/cjs/nesting.js +406 -0
  32. package/dist/cjs/nesting.js.map +1 -0
  33. package/dist/cjs/package.json +3 -0
  34. package/dist/cjs/runtime.js +257 -0
  35. package/dist/cjs/runtime.js.map +1 -0
  36. package/dist/cjs/styles/authoring.js +169 -0
  37. package/dist/cjs/styles/authoring.js.map +1 -0
  38. package/dist/cjs/styles/declarations.js +139 -0
  39. package/dist/cjs/styles/declarations.js.map +1 -0
  40. package/dist/cjs/styles/index.js +32 -0
  41. package/dist/cjs/styles/index.js.map +1 -0
  42. package/dist/cjs/styles/module.js +233 -0
  43. package/dist/cjs/styles/module.js.map +1 -0
  44. package/dist/cjs/styles/registry.js +187 -0
  45. package/dist/cjs/styles/registry.js.map +1 -0
  46. package/dist/cjs/styles/types.js +9 -0
  47. package/dist/cjs/styles/types.js.map +1 -0
  48. package/dist/cjs/testing.js +37 -0
  49. package/dist/cjs/testing.js.map +1 -0
  50. package/dist/cjs/theme.js +249 -0
  51. package/dist/cjs/theme.js.map +1 -0
  52. package/dist/cjs/tokens/contextual_var.js +39 -0
  53. package/dist/cjs/tokens/contextual_var.js.map +1 -0
  54. package/dist/cjs/tokens/index.js +24 -0
  55. package/dist/cjs/tokens/index.js.map +1 -0
  56. package/dist/cjs/tokens/kind.js +14 -0
  57. package/dist/cjs/tokens/kind.js.map +1 -0
  58. package/dist/cjs/tokens/light_dark.js +42 -0
  59. package/dist/cjs/tokens/light_dark.js.map +1 -0
  60. package/dist/cjs/tokens/scale_token.js +28 -0
  61. package/dist/cjs/tokens/scale_token.js.map +1 -0
  62. package/dist/cjs/tokens/theme_token.js +28 -0
  63. package/dist/cjs/tokens/theme_token.js.map +1 -0
  64. package/dist/cjs/var_invariant.js +115 -0
  65. package/dist/cjs/var_invariant.js.map +1 -0
  66. package/dist/collector.d.ts +84 -0
  67. package/dist/collector.d.ts.map +1 -0
  68. package/dist/collector.js +416 -0
  69. package/dist/collector.js.map +1 -0
  70. package/dist/css_scan.d.ts +57 -0
  71. package/dist/css_scan.d.ts.map +1 -0
  72. package/dist/css_scan.js +180 -0
  73. package/dist/css_scan.js.map +1 -0
  74. package/dist/dom_sink.d.ts +27 -0
  75. package/dist/dom_sink.d.ts.map +1 -0
  76. package/dist/dom_sink.js +36 -0
  77. package/dist/dom_sink.js.map +1 -0
  78. package/dist/emotion.d.ts +47 -0
  79. package/dist/emotion.d.ts.map +1 -0
  80. package/dist/emotion.js +184 -0
  81. package/dist/emotion.js.map +1 -0
  82. package/dist/engine.d.ts +41 -0
  83. package/dist/engine.d.ts.map +1 -0
  84. package/dist/engine.js +75 -0
  85. package/dist/engine.js.map +1 -0
  86. package/dist/environment.d.ts +43 -0
  87. package/dist/environment.d.ts.map +1 -0
  88. package/dist/environment.js +8 -0
  89. package/dist/environment.js.map +1 -0
  90. package/dist/hash.d.ts +2 -0
  91. package/dist/hash.d.ts.map +1 -0
  92. package/dist/hash.js +82 -0
  93. package/dist/hash.js.map +1 -0
  94. package/dist/idents.d.ts +9 -0
  95. package/dist/idents.d.ts.map +1 -0
  96. package/dist/idents.js +19 -0
  97. package/dist/idents.js.map +1 -0
  98. package/dist/index.d.ts +9 -0
  99. package/dist/index.d.ts.map +1 -0
  100. package/dist/index.js +14 -0
  101. package/dist/index.js.map +1 -0
  102. package/dist/instance.d.ts +16 -0
  103. package/dist/instance.d.ts.map +1 -0
  104. package/dist/instance.js +30 -0
  105. package/dist/instance.js.map +1 -0
  106. package/dist/local_vars.d.ts +75 -0
  107. package/dist/local_vars.d.ts.map +1 -0
  108. package/dist/local_vars.js +92 -0
  109. package/dist/local_vars.js.map +1 -0
  110. package/dist/minify.d.ts +11 -0
  111. package/dist/minify.d.ts.map +1 -0
  112. package/dist/minify.js +73 -0
  113. package/dist/minify.js.map +1 -0
  114. package/dist/names.d.ts +39 -0
  115. package/dist/names.d.ts.map +1 -0
  116. package/dist/names.js +70 -0
  117. package/dist/names.js.map +1 -0
  118. package/dist/nesting.d.ts +59 -0
  119. package/dist/nesting.d.ts.map +1 -0
  120. package/dist/nesting.js +400 -0
  121. package/dist/nesting.js.map +1 -0
  122. package/dist/runtime.d.ts +36 -0
  123. package/dist/runtime.d.ts.map +1 -0
  124. package/dist/runtime.js +252 -0
  125. package/dist/runtime.js.map +1 -0
  126. package/dist/styles/authoring.d.ts +59 -0
  127. package/dist/styles/authoring.d.ts.map +1 -0
  128. package/dist/styles/authoring.js +155 -0
  129. package/dist/styles/authoring.js.map +1 -0
  130. package/dist/styles/declarations.d.ts +10 -0
  131. package/dist/styles/declarations.d.ts.map +1 -0
  132. package/dist/styles/declarations.js +132 -0
  133. package/dist/styles/declarations.js.map +1 -0
  134. package/dist/styles/index.d.ts +7 -0
  135. package/dist/styles/index.d.ts.map +1 -0
  136. package/dist/styles/index.js +12 -0
  137. package/dist/styles/index.js.map +1 -0
  138. package/dist/styles/module.d.ts +5 -0
  139. package/dist/styles/module.d.ts.map +1 -0
  140. package/dist/styles/module.js +229 -0
  141. package/dist/styles/module.js.map +1 -0
  142. package/dist/styles/registry.d.ts +48 -0
  143. package/dist/styles/registry.d.ts.map +1 -0
  144. package/dist/styles/registry.js +182 -0
  145. package/dist/styles/registry.js.map +1 -0
  146. package/dist/styles/types.d.ts +211 -0
  147. package/dist/styles/types.d.ts.map +1 -0
  148. package/dist/styles/types.js +8 -0
  149. package/dist/styles/types.js.map +1 -0
  150. package/dist/testing.d.ts +10 -0
  151. package/dist/testing.d.ts.map +1 -0
  152. package/dist/testing.js +31 -0
  153. package/dist/testing.js.map +1 -0
  154. package/dist/theme.d.ts +85 -0
  155. package/dist/theme.d.ts.map +1 -0
  156. package/dist/theme.js +240 -0
  157. package/dist/theme.js.map +1 -0
  158. package/dist/tokens/contextual_var.d.ts +35 -0
  159. package/dist/tokens/contextual_var.d.ts.map +1 -0
  160. package/dist/tokens/contextual_var.js +33 -0
  161. package/dist/tokens/contextual_var.js.map +1 -0
  162. package/dist/tokens/index.d.ts +5 -0
  163. package/dist/tokens/index.d.ts.map +1 -0
  164. package/dist/tokens/index.js +11 -0
  165. package/dist/tokens/index.js.map +1 -0
  166. package/dist/tokens/kind.d.ts +2 -0
  167. package/dist/tokens/kind.d.ts.map +1 -0
  168. package/dist/tokens/kind.js +10 -0
  169. package/dist/tokens/kind.js.map +1 -0
  170. package/dist/tokens/light_dark.d.ts +20 -0
  171. package/dist/tokens/light_dark.d.ts.map +1 -0
  172. package/dist/tokens/light_dark.js +37 -0
  173. package/dist/tokens/light_dark.js.map +1 -0
  174. package/dist/tokens/scale_token.d.ts +20 -0
  175. package/dist/tokens/scale_token.d.ts.map +1 -0
  176. package/dist/tokens/scale_token.js +23 -0
  177. package/dist/tokens/scale_token.js.map +1 -0
  178. package/dist/tokens/theme_token.d.ts +20 -0
  179. package/dist/tokens/theme_token.d.ts.map +1 -0
  180. package/dist/tokens/theme_token.js +23 -0
  181. package/dist/tokens/theme_token.js.map +1 -0
  182. package/dist/var_invariant.d.ts +25 -0
  183. package/dist/var_invariant.d.ts.map +1 -0
  184. package/dist/var_invariant.js +108 -0
  185. package/dist/var_invariant.js.map +1 -0
  186. package/docs/concepts/authoring.md +115 -0
  187. package/docs/concepts/collection.md +66 -0
  188. package/docs/concepts/distillery.md +47 -0
  189. package/docs/concepts/index.md +18 -0
  190. package/docs/concepts/naming-and-output.md +123 -0
  191. package/docs/concepts/ordering.md +61 -0
  192. package/docs/concepts/single-copy.md +103 -0
  193. package/docs/concepts/tokens.md +99 -0
  194. package/docs/docset.yml +53 -0
  195. package/docs/examples/01-stylesheet.ts +20 -0
  196. package/docs/examples/02-artifact.ts +26 -0
  197. package/docs/examples/03-variants.ts +40 -0
  198. package/docs/examples/04-emotion.ts +33 -0
  199. package/docs/examples/05-var-invariant.ts +31 -0
  200. package/docs/examples/06-payload.ts +85 -0
  201. package/docs/examples/fixture.ts +22 -0
  202. package/docs/getting-started/index.md +14 -0
  203. package/docs/getting-started/installation.md +30 -0
  204. package/docs/getting-started/quick-start.md +61 -0
  205. package/docs/getting-started/your-first-stylesheet.md +57 -0
  206. package/docs/guides/compact-artifacts.md +87 -0
  207. package/docs/guides/emotion-migration.md +60 -0
  208. package/docs/guides/index.md +17 -0
  209. package/docs/guides/name-collisions.md +37 -0
  210. package/docs/guides/non-css-surfaces.md +73 -0
  211. package/docs/guides/react-renderer.md +158 -0
  212. package/docs/guides/theming.md +107 -0
  213. package/docs/guides/var-invariant.md +24 -0
  214. package/docs/guides/vs-emotion.md +61 -0
  215. package/docs/index.md +73 -0
  216. package/docs/logo.svg +7 -0
  217. package/docs/playground/index.html +12 -0
  218. package/docs/playground/package.json +23 -0
  219. package/docs/playground/src/app/app.tsx +109 -0
  220. package/docs/playground/src/app/css_panel.tsx +119 -0
  221. package/docs/playground/src/app/editor_panel.tsx +87 -0
  222. package/docs/playground/src/app/index.ts +8 -0
  223. package/docs/playground/src/app/monaco_css_editor.tsx +84 -0
  224. package/docs/playground/src/app/monaco_source_editor.tsx +132 -0
  225. package/docs/playground/src/app/preview_panel.tsx +99 -0
  226. package/docs/playground/src/app/tokens_panel.tsx +117 -0
  227. package/docs/playground/src/app/types.ts +10 -0
  228. package/docs/playground/src/examples/snippets.test.ts +28 -0
  229. package/docs/playground/src/examples/snippets.ts +418 -0
  230. package/docs/playground/src/lib/compile.test.ts +157 -0
  231. package/docs/playground/src/lib/compile.ts +242 -0
  232. package/docs/playground/src/lib/demo_environment.test.ts +123 -0
  233. package/docs/playground/src/lib/demo_environment.ts +140 -0
  234. package/docs/playground/src/lib/editor_lib.test.ts +39 -0
  235. package/docs/playground/src/lib/editor_lib.ts +142 -0
  236. package/docs/playground/src/lib/format_css.test.ts +41 -0
  237. package/docs/playground/src/lib/format_css.ts +71 -0
  238. package/docs/playground/src/main.tsx +25 -0
  239. package/docs/playground/src/setup/chrome.test.ts +47 -0
  240. package/docs/playground/src/setup/chrome.ts +365 -0
  241. package/docs/playground/src/setup/monaco_env.ts +64 -0
  242. package/docs/playground/tsconfig.json +22 -0
  243. package/docs/playground/vite.config.ts +37 -0
  244. package/docs/playground/vitest.config.ts +35 -0
  245. package/docs/playground.md +28 -0
  246. package/docs/reference/api/emotion.md +372 -0
  247. package/docs/reference/api/index-1.md +2180 -0
  248. package/docs/reference/api/index.md +9 -0
  249. package/docs/reference/api/testing.md +92 -0
  250. package/docs/reference/api.md +12 -0
  251. package/docs/reference/entry-points.md +125 -0
  252. package/docs/reference/environment.md +60 -0
  253. package/docs/reference/index.md +11 -0
  254. package/docs/reference/okf-map.md +92 -0
  255. package/package.json +127 -4
  256. package/src/collector.ts +526 -0
  257. package/src/css_scan.ts +263 -0
  258. package/src/dom_sink.ts +65 -0
  259. package/src/emotion.ts +311 -0
  260. package/src/engine.ts +191 -0
  261. package/src/environment.ts +56 -0
  262. package/src/hash.ts +111 -0
  263. package/src/idents.ts +21 -0
  264. package/src/index.ts +93 -0
  265. package/src/instance.ts +49 -0
  266. package/src/local_vars.ts +220 -0
  267. package/src/minify.ts +87 -0
  268. package/src/names.ts +129 -0
  269. package/src/nesting.ts +596 -0
  270. package/src/runtime.ts +428 -0
  271. package/src/styles/authoring.ts +244 -0
  272. package/src/styles/declarations.ts +172 -0
  273. package/src/styles/index.ts +58 -0
  274. package/src/styles/module.ts +396 -0
  275. package/src/styles/registry.ts +261 -0
  276. package/src/styles/types.ts +283 -0
  277. package/src/testing.ts +48 -0
  278. package/src/theme.ts +454 -0
  279. package/src/tokens/contextual_var.ts +72 -0
  280. package/src/tokens/index.ts +17 -0
  281. package/src/tokens/kind.ts +13 -0
  282. package/src/tokens/light_dark.ts +58 -0
  283. package/src/tokens/scale_token.ts +41 -0
  284. package/src/tokens/theme_token.ts +42 -0
  285. package/src/var_invariant.ts +147 -0
@@ -0,0 +1,2180 @@
1
+ # index
2
+
3
+ ## Classes
4
+
5
+ ### StyleRegistry [#styleregistry]
6
+
7
+ Defined in: [styles/registry.ts:22](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/registry.ts#L22)
8
+
9
+ Registered style modules for one distillery. Throws on duplicate module names or colliding readable class/var names.
10
+
11
+ #### Constructors
12
+
13
+ ##### Constructor
14
+
15
+ ```ts
16
+ new StyleRegistry(
17
+ prefix,
18
+ reservedVarOwners?,
19
+ sharedVarPaths?
20
+ ): StyleRegistry;
21
+ ```
22
+
23
+ Defined in: [styles/registry.ts:26](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/registry.ts#L26)
24
+
25
+ ###### Parameters
26
+
27
+ | Parameter | Type |
28
+ | ------ | ------ |
29
+ | `prefix` | `string` |
30
+ | `reservedVarOwners` | `ReadonlyMap`\<`string`, `string`\> |
31
+ | `sharedVarPaths` | `ReadonlySet`\<`string`\> |
32
+
33
+ ###### Returns
34
+
35
+ [`StyleRegistry`](#styleregistry)
36
+
37
+ #### Accessors
38
+
39
+ ##### classKeys [#classkeys]
40
+
41
+ ###### Get Signature
42
+
43
+ ```ts
44
+ get classKeys(): readonly string[];
45
+ ```
46
+
47
+ Defined in: [styles/registry.ts:98](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/registry.ts#L98)
48
+
49
+ Handle keys across all modules. Compact-name domain for a full stylesheet.
50
+
51
+ ###### Returns
52
+
53
+ readonly `string`[]
54
+
55
+ ##### cssVarKeys [#cssvarkeys]
56
+
57
+ ###### Get Signature
58
+
59
+ ```ts
60
+ get cssVarKeys(): readonly string[];
61
+ ```
62
+
63
+ Defined in: [styles/registry.ts:105](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/registry.ts#L105)
64
+
65
+ Theme and contextual-var keys across all modules.
66
+
67
+ ###### Returns
68
+
69
+ readonly `string`[]
70
+
71
+ ##### modules [#modules]
72
+
73
+ ###### Get Signature
74
+
75
+ ```ts
76
+ get modules(): readonly StylesModule<StylesObject>[];
77
+ ```
78
+
79
+ Defined in: [styles/registry.ts:86](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/registry.ts#L86)
80
+
81
+ Registered modules, sorted by name.
82
+
83
+ ###### Returns
84
+
85
+ readonly [`StylesModule`](#stylesmodule)\<[`StylesObject`](#stylesobject)\>[]
86
+
87
+ #### Methods
88
+
89
+ ##### freeze() [#freeze]
90
+
91
+ ```ts
92
+ freeze(options?): StyleRegistrySnapshot;
93
+ ```
94
+
95
+ Defined in: [styles/registry.ts:119](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/registry.ts#L119)
96
+
97
+ Frozen class and CSS-var keys for a [StyleNameResolver](#stylenameresolver).
98
+
99
+ ###### Parameters
100
+
101
+ | Parameter | Type | Description |
102
+ | ------ | ------ | ------ |
103
+ | `options` | \{ `classKeys?`: `Iterable`\<`string`, `any`, `any`\>; `cssVarKeys?`: `Iterable`\<`string`, `any`, `any`\>; \} | Overrides the registry-wide key sets when compact-naming a subset. |
104
+ | `options.classKeys?` | `Iterable`\<`string`, `any`, `any`\> | Compact class-name domain override. |
105
+ | `options.cssVarKeys?` | `Iterable`\<`string`, `any`, `any`\> | Compact CSS-var domain override. |
106
+
107
+ ###### Returns
108
+
109
+ [`StyleRegistrySnapshot`](#styleregistrysnapshot)
110
+
111
+ ##### module() [#module]
112
+
113
+ ```ts
114
+ module(name):
115
+ | StylesModule<StylesObject>
116
+ | undefined;
117
+ ```
118
+
119
+ Defined in: [styles/registry.ts:93](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/registry.ts#L93)
120
+
121
+ Looks up a module by the name passed to `createStyleModule`.
122
+
123
+ ###### Parameters
124
+
125
+ | Parameter | Type |
126
+ | ------ | ------ |
127
+ | `name` | `string` |
128
+
129
+ ###### Returns
130
+
131
+ \| [`StylesModule`](#stylesmodule)\<[`StylesObject`](#stylesobject)\>
132
+ \| `undefined`
133
+
134
+ ##### registerModule() [#registermodule]
135
+
136
+ ```ts
137
+ registerModule(module): void;
138
+ ```
139
+
140
+ Defined in: [styles/registry.ts:37](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/registry.ts#L37)
141
+
142
+ Adds `module` to this registry.
143
+
144
+ ###### Parameters
145
+
146
+ | Parameter | Type |
147
+ | ------ | ------ |
148
+ | `module` | [`StylesModule`](#stylesmodule) |
149
+
150
+ ###### Returns
151
+
152
+ `void`
153
+
154
+ ###### Throws
155
+
156
+ If another module already uses this name, or if a readable class or CSS-variable name collides (including `themeVars` and `sharedVars`).
157
+
158
+ ##### targetsHandle() [#targetshandle]
159
+
160
+ ```ts
161
+ targetsHandle(key): boolean;
162
+ ```
163
+
164
+ Defined in: [styles/registry.ts:61](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/registry.ts#L61)
165
+
166
+ True when some rule, or some inner rule of an `@media` / `@container` block, reads `key` in its selector.
167
+
168
+ A nested `&` rule records its owning handle through `recordRuleDeps`, so a handle with an empty self block but real nested rules is targeted. A rule-less nested block targets nothing.
169
+
170
+ ###### Parameters
171
+
172
+ | Parameter | Type |
173
+ | ------ | ------ |
174
+ | `key` | `string` |
175
+
176
+ ###### Returns
177
+
178
+ `boolean`
179
+
180
+ ***
181
+
182
+ ### StylesCollector [#stylescollector]
183
+
184
+ Defined in: [collector.ts:101](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L101)
185
+
186
+ Reachable entries for one render or one stylesheet.
187
+
188
+ #### Constructors
189
+
190
+ ##### Constructor
191
+
192
+ ```ts
193
+ new StylesCollector(__namedParameters): StylesCollector;
194
+ ```
195
+
196
+ Defined in: [collector.ts:117](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L117)
197
+
198
+ ###### Parameters
199
+
200
+ | Parameter | Type |
201
+ | ------ | ------ |
202
+ | `__namedParameters` | [`StylesCollectorOptions`](#stylescollectoroptions) |
203
+
204
+ ###### Returns
205
+
206
+ [`StylesCollector`](#stylescollector)
207
+
208
+ #### Properties
209
+
210
+ | Property | Modifier | Type | Description | Defined in |
211
+ | ------ | ------ | ------ | ------ | ------ |
212
+ | $$$names$$$ `names` | `readonly` | [`StyleNameMode`](#stylenamemode) | The naming mode (compact vs readable). | [collector.ts:105](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L105) |
213
+ | $$$prefix$$$ `prefix` | `readonly` | `string` | Emitted class name prefix. | [collector.ts:109](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L109) |
214
+ | $$$registry$$$ `registry` | `readonly` | [`StyleRegistry`](#styleregistry) | Associated registry. | [collector.ts:107](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L107) |
215
+ | $$$target$$$ `target` | `readonly` | [`StyleTarget`](#styletarget) | The target collection mode. | [collector.ts:103](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L103) |
216
+
217
+ #### Accessors
218
+
219
+ ##### collectedEntries [#collectedentries]
220
+
221
+ ###### Get Signature
222
+
223
+ ```ts
224
+ get collectedEntries(): readonly StyleEntry[];
225
+ ```
226
+
227
+ Defined in: [collector.ts:318](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L318)
228
+
229
+ Collected style entries sorted for emission (base rules before all `@media`/`@container` blocks).
230
+
231
+ ###### Returns
232
+
233
+ readonly [`StyleEntry`](#styleentry)[]
234
+
235
+ ##### collectedThemeDeps [#collectedthemedeps]
236
+
237
+ ###### Get Signature
238
+
239
+ ```ts
240
+ get collectedThemeDeps(): ReadonlySet<string>;
241
+ ```
242
+
243
+ Defined in: [collector.ts:323](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L323)
244
+
245
+ Theme token paths that survive reachability; emitted in the theme scope block.
246
+
247
+ ###### Returns
248
+
249
+ `ReadonlySet`\<`string`\>
250
+
251
+ ##### collectedVarDeps [#collectedvardeps]
252
+
253
+ ###### Get Signature
254
+
255
+ ```ts
256
+ get collectedVarDeps(): ReadonlySet<`vars/${string}`>;
257
+ ```
258
+
259
+ Defined in: [collector.ts:328](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L328)
260
+
261
+ Contextual var paths that survive reachability; used by the runtime for compact-name substitution.
262
+
263
+ ###### Returns
264
+
265
+ `ReadonlySet`\<`` `vars/${string}` ``\>
266
+
267
+ #### Methods
268
+
269
+ ##### createResolver() [#createresolver]
270
+
271
+ ```ts
272
+ createResolver(): StyleNameResolver;
273
+ ```
274
+
275
+ Defined in: [collector.ts:300](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L300)
276
+
277
+ Creates a [StyleNameResolver](#stylenameresolver) scoped to this collector's current dep set.
278
+
279
+ ###### Returns
280
+
281
+ [`StyleNameResolver`](#stylenameresolver)
282
+
283
+ ##### reachableDefaults() [#reachabledefaults]
284
+
285
+ ```ts
286
+ reachableDefaults(handle, groupPath): ReadonlySet<string>;
287
+ ```
288
+
289
+ Defined in: [collector.ts:343](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L343)
290
+
291
+ Returns the variable keys within `groupPath` that are reachable from `handle` or from any collected rule targeting it.
292
+
293
+ ###### Parameters
294
+
295
+ | Parameter | Type | Description |
296
+ | ------ | ------ | ------ |
297
+ | `handle` | [`StyleHandle`](#stylehandle) | Handle whose declaration refs and dependent rules are consulted. |
298
+ | `groupPath` | `` `vars/${string}` `` | Group prefix path (e.g. `vars/chip/look`). |
299
+
300
+ ###### Returns
301
+
302
+ `ReadonlySet`\<`string`\>
303
+
304
+ ##### use() [#use]
305
+
306
+ ```ts
307
+ use(value): void;
308
+ ```
309
+
310
+ Defined in: [collector.ts:140](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L140)
311
+
312
+ Collects a module's non-variant entries, or one explicit entry.
313
+
314
+ Variant entries stay off this path; collect them via `useHandles`.
315
+
316
+ ###### Parameters
317
+
318
+ | Parameter | Type | Description |
319
+ | ------ | ------ | ------ |
320
+ | `value` | \| [`StyleEntry`](#styleentry) \| readonly [`StyleEntry`](#styleentry)[] \| [`StylesModule`](#stylesmodule)\<[`StylesObject`](#stylesobject)\> | Module (all non-variant entries), a single entry, or an array of entries. |
321
+
322
+ ###### Returns
323
+
324
+ `void`
325
+
326
+ ##### useAllEntries() [#useallentries]
327
+
328
+ ```ts
329
+ useAllEntries(module): void;
330
+ ```
331
+
332
+ Defined in: [collector.ts:187](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L187)
333
+
334
+ Collects every entry on `module`, including variants. Used by the stylesheet target.
335
+
336
+ ###### Parameters
337
+
338
+ | Parameter | Type | Description |
339
+ | ------ | ------ | ------ |
340
+ | `module` | [`StylesModule`](#stylesmodule) | Module whose entries should all be collected. |
341
+
342
+ ###### Returns
343
+
344
+ `void`
345
+
346
+ ##### useHandles() [#usehandles]
347
+
348
+ ```ts
349
+ useHandles(handles): readonly StyleHandle[];
350
+ ```
351
+
352
+ Defined in: [collector.ts:212](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L212)
353
+
354
+ Collects handles and auto-includes rules whose selector deps are all present.
355
+
356
+ Media blocks include only inner rules whose deps are met.
357
+
358
+ ###### Parameters
359
+
360
+ | Parameter | Type | Description |
361
+ | ------ | ------ | ------ |
362
+ | `handles` | readonly [`StyleHandle`](#stylehandle)[] | Handles resolved during this render pass (e.g. from `resolveClassName`). |
363
+
364
+ ###### Returns
365
+
366
+ readonly [`StyleHandle`](#stylehandle)[]
367
+
368
+ Handles that were retained. Empty untargeted handles are omitted in compact mode.
369
+
370
+ ##### useRulesWhenDepsMet() [#useruleswhendepsmet]
371
+
372
+ ```ts
373
+ useRulesWhenDepsMet(module): void;
374
+ ```
375
+
376
+ Defined in: [collector.ts:239](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L239)
377
+
378
+ Collects `auto` rules on `module` whose every selector dependency is already collected.
379
+
380
+ ###### Parameters
381
+
382
+ | Parameter | Type |
383
+ | ------ | ------ |
384
+ | `module` | [`StylesModule`](#stylesmodule) |
385
+
386
+ ###### Returns
387
+
388
+ `void`
389
+
390
+ ##### useThemeVar() [#usethemevar]
391
+
392
+ ```ts
393
+ useThemeVar(path): void;
394
+ ```
395
+
396
+ Defined in: [collector.ts:295](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L295)
397
+
398
+ Marks a theme token path as reachable so it appears in the emitted theme block, even if no collected declaration reads it.
399
+
400
+ ###### Parameters
401
+
402
+ | Parameter | Type |
403
+ | ------ | ------ |
404
+ | `path` | `string` |
405
+
406
+ ###### Returns
407
+
408
+ `void`
409
+
410
+ ## Interfaces
411
+
412
+ ### ContextualCssVar [#contextualcssvar]
413
+
414
+ Defined in: [tokens/contextual\_var.ts:25](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L25)
415
+
416
+ Represents a contextual CSS variable. Stringifies to `var(--...)`.
417
+
418
+ #### Properties
419
+
420
+ | Property | Modifier | Type | Description | Defined in |
421
+ | ------ | ------ | ------ | ------ | ------ |
422
+ | $$$__kind$$$ `__kind` | `readonly` | `"contextual-var"` | Brand for [isContextualCssVar](#iscontextualcssvar). | [tokens/contextual\_var.ts:27](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L27) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L31) |
424
+ | $$$path$$$ `path` | `readonly` | `` `vars/${string}` `` | Group/key path for this variable. | [tokens/contextual\_var.ts:29](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L29) |
425
+ | $$$ref$$$ `ref` | `readonly` | `` `var(--${string})` `` | Usable CSS `var(...)` reference string. | [tokens/contextual\_var.ts:33](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L33) |
426
+
427
+ #### Methods
428
+
429
+ ##### \[toPrimitive\]() [#toprimitive]
430
+
431
+ ```ts
432
+ toPrimitive: string;
433
+ ```
434
+
435
+ Defined in: [tokens/contextual\_var.ts:37](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L37)
436
+
437
+ Template interpolation; same as [ContextualCssVar.toString](#tostring).
438
+
439
+ ###### Parameters
440
+
441
+ | Parameter | Type |
442
+ | ------ | ------ |
443
+ | `hint` | `string` |
444
+
445
+ ###### Returns
446
+
447
+ `string`
448
+
449
+ ##### toString() [#tostring]
450
+
451
+ ```ts
452
+ toString(): string;
453
+ ```
454
+
455
+ Defined in: [tokens/contextual\_var.ts:35](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L35)
456
+
457
+ Stringifies to [ContextualCssVar.ref](#ref).
458
+
459
+ ###### Returns
460
+
461
+ `string`
462
+
463
+ ***
464
+
465
+ ### ContextualCssVarName [#contextualcssvarname-1]
466
+
467
+ Defined in: [tokens/contextual\_var.ts:11](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L11)
468
+
469
+ Represents a contextual CSS variable name. Stringifies to its custom property name.
470
+
471
+ #### Properties
472
+
473
+ | Property | Modifier | Type | Description | Defined in |
474
+ | ------ | ------ | ------ | ------ | ------ |
475
+ | $$$__kind-1$$$ `__kind` | `readonly` | `"contextual-var-name"` | Brand for [isContextualCssVarName](#iscontextualcssvarname). | [tokens/contextual\_var.ts:13](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L13) |
476
+ | $$$name-1$$$ `name` | `readonly` | `` `--${string}` `` | Actual emitted CSS custom property name. | [tokens/contextual\_var.ts:17](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L17) |
477
+ | $$$path-1$$$ `path` | `readonly` | `` `vars/${string}` `` | Group/key path for this variable. | [tokens/contextual\_var.ts:15](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L15) |
478
+
479
+ #### Methods
480
+
481
+ ##### \[toPrimitive\]() [#toprimitive-1]
482
+
483
+ ```ts
484
+ toPrimitive: string;
485
+ ```
486
+
487
+ Defined in: [tokens/contextual\_var.ts:21](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L21)
488
+
489
+ Template interpolation; same as [ContextualCssVarName.toString](#tostring-1).
490
+
491
+ ###### Parameters
492
+
493
+ | Parameter | Type |
494
+ | ------ | ------ |
495
+ | `hint` | `string` |
496
+
497
+ ###### Returns
498
+
499
+ `string`
500
+
501
+ ##### toString() [#tostring-1]
502
+
503
+ ```ts
504
+ toString(): string;
505
+ ```
506
+
507
+ Defined in: [tokens/contextual\_var.ts:19](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L19)
508
+
509
+ Stringifies to [ContextualCssVarName.name](#name-1).
510
+
511
+ ###### Returns
512
+
513
+ `string`
514
+
515
+ ***
516
+
517
+ ### CssToken [#csstoken]
518
+
519
+ Defined in: [tokens/theme\_token.ts:11](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/theme_token.ts#L11)
520
+
521
+ Represents a CSS theme token. Stringifies to `var(--...)`.
522
+
523
+ #### Properties
524
+
525
+ | Property | Modifier | Type | Description | Defined in |
526
+ | ------ | ------ | ------ | ------ | ------ |
527
+ | $$$__kind-2$$$ `__kind` | `readonly` | `"theme-token"` | Brand for [isCssToken](#iscsstoken). | [tokens/theme\_token.ts:13](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/theme_token.ts#L13) |
528
+ | $$$cssvar$$$ `cssVar` | `readonly` | `` `--${string}` `` | Actual emitted CSS custom property name. | [tokens/theme\_token.ts:17](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/theme_token.ts#L17) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/theme_token.ts#L15) |
530
+ | $$$ref-1$$$ `ref` | `readonly` | `` `var(--${string})` `` | Usable CSS `var(...)` reference string. | [tokens/theme\_token.ts:19](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/theme_token.ts#L19) |
531
+
532
+ #### Methods
533
+
534
+ ##### \[toPrimitive\]() [#toprimitive-2]
535
+
536
+ ```ts
537
+ toPrimitive: string;
538
+ ```
539
+
540
+ Defined in: [tokens/theme\_token.ts:23](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/theme_token.ts#L23)
541
+
542
+ Template interpolation; same as [CssToken.toString](#tostring-2).
543
+
544
+ ###### Parameters
545
+
546
+ | Parameter | Type |
547
+ | ------ | ------ |
548
+ | `hint` | `string` |
549
+
550
+ ###### Returns
551
+
552
+ `string`
553
+
554
+ ##### toString() [#tostring-2]
555
+
556
+ ```ts
557
+ toString(): string;
558
+ ```
559
+
560
+ Defined in: [tokens/theme\_token.ts:21](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/theme_token.ts#L21)
561
+
562
+ Stringifies to [CssToken.ref](#ref-1).
563
+
564
+ ###### Returns
565
+
566
+ `string`
567
+
568
+ ***
569
+
570
+ ### Declarations [#declarations]
571
+
572
+ Defined in: [styles/types.ts:97](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L97)
573
+
574
+ Authored CSS plus the deps the collector uses for reachability.
575
+
576
+ #### Properties
577
+
578
+ | Property | Modifier | Type | Description | Defined in |
579
+ | ------ | ------ | ------ | ------ | ------ |
580
+ | $$$css$$$ `css` | `readonly` | readonly [`DeclarationSegment`](#declarationsegment)[] | Interleaved literal CSS and local variable markers. | [styles/types.ts:99](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L99) |
581
+ | $$$deps$$$ `deps` | `readonly` | [`StyleDeps`](#styledeps) | Reachability tracking dependencies. | [styles/types.ts:101](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L101) |
582
+
583
+ ***
584
+
585
+ ### DefaultGroupDeps [#defaultgroupdeps]
586
+
587
+ Defined in: [styles/types.ts:59](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L59)
588
+
589
+ One `t.vars(...)` group's default-emission metadata.
590
+
591
+ #### Properties
592
+
593
+ | Property | Modifier | Type | Description | Defined in |
594
+ | ------ | ------ | ------ | ------ | ------ |
595
+ | $$$grouppath$$$ `groupPath` | `readonly` | `` `vars/${string}` `` | Target variable namespace group. | [styles/types.ts:61](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L61) |
596
+ | $$$keys$$$ `keys` | `readonly` | readonly [`DefaultKeyDeps`](#defaultkeydeps)[] | Defaults registered within this group. | [styles/types.ts:63](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L63) |
597
+
598
+ ***
599
+
600
+ ### DefaultKeyDeps [#defaultkeydeps]
601
+
602
+ Defined in: [styles/types.ts:67](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L67)
603
+
604
+ One key inside a [DefaultGroupDeps](#defaultgroupdeps) group.
605
+
606
+ #### Properties
607
+
608
+ | Property | Modifier | Type | Description | Defined in |
609
+ | ------ | ------ | ------ | ------ | ------ |
610
+ | $$$key$$$ `key` | `readonly` | `string` | The specific variable key within the group. | [styles/types.ts:69](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L69) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L71) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L73) |
613
+ | `valueDeps.theme` | `readonly` | `ReadonlySet`\<`string`\> | Theme-token paths the default value interpolates. | [styles/types.ts:75](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L75) |
614
+ | `valueDeps.vars` | `readonly` | `ReadonlySet`\<`` `vars/${string}` ``\> | Contextual-var paths the default value interpolates. | [styles/types.ts:77](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L77) |
615
+
616
+ ***
617
+
618
+ ### Distillery [#distillery]
619
+
620
+ Defined in: [engine.ts:43](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/engine.ts#L43)
621
+
622
+ One component library's binding: environment, registry, and pre-bound operations. Destructure-safe (no `this`).
623
+
624
+ #### Type Parameters
625
+
626
+ | Type Parameter | Default type |
627
+ | ------ | ------ |
628
+ | `TTokens` | `unknown` |
629
+ | `TTheme` *extends* [`ThemeTree`](#themetree) | [`ThemeTree`](#themetree) |
630
+
631
+ #### Properties
632
+
633
+ | Property | Modifier | Type | Description | Defined in |
634
+ | ------ | ------ | ------ | ------ | ------ |
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:73](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/engine.ts#L73) |
636
+ | $$$createnameresolver$$$ `createNameResolver` | `readonly` | (`options`) => [`StyleNameResolver`](#stylenameresolver) | Creates a standalone name resolver using this distillery's prefix. | [engine.ts:89](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/engine.ts#L89) |
637
+ | $$$createstylemodule$$$ `createStyleModule` | `readonly` | \<`TStyles`\>(`name`, `factory`) => [`StylesModule`](#stylesmodule)\<[`ResolvedStyles`](#resolvedstyles)\<`TStyles`\>\> | Named handle tree plus tokens. | [engine.ts:63](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/engine.ts#L63) |
638
+ | $$$dev$$$ `dev` | `readonly` | `boolean` | When `true`, collectors warn about no-op handles. | [engine.ts:61](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/engine.ts#L61) |
639
+ | $$$environment$$$ `environment` | `readonly` | [`DistilleryEnvironment`](#distilleryenvironment-1)\<`TTokens`\> | Resolved environment (tokens, prefix, derived theme vars). | [engine.ts:48](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/engine.ts#L48) |
640
+ | $$$primitivestyles$$$ `primitiveStyles` | `readonly` | \<`TStyles`\>(`name`, `factory`) => [`StylesModule`](#stylesmodule)\<[`ResolvedStyles`](#resolvedstyles)\<`TStyles`\>\> | Named handles plus tokens only. | [engine.ts:68](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/engine.ts#L68) |
641
+ | $$$registry-1$$$ `registry` | `readonly` | [`StyleRegistry`](#styleregistry) | The module registry accumulating collected handles and rules. | [engine.ts:59](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/engine.ts#L59) |
642
+ | $$$renderstyles$$$ `renderStyles` | `readonly` | (`collector`, `resolver?`, `options?`) => `string` | Emits collected CSS for this environment. | [engine.ts:83](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/engine.ts#L83) |
643
+ | $$$resolvevalues$$$ `resolveValues` | `readonly` | (`scheme`, `variation?`) => [`ValuesOf`](#valuesof)\<`TTheme`\> | Nested literal values for one scheme. Optional `variation` is a name from `variations`. | [engine.ts:54](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/engine.ts#L54) |
644
+ | $$$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:78](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/engine.ts#L78) |
645
+ | $$$themevars$$$ `themeVars` | `readonly` | `Readonly`\<`Record`\<`string`, [`ThemeVarDefinition`](#themevardefinition)\>\> | Derived theme-var registry, same object as `environment.themeVars`. | [engine.ts:52](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/engine.ts#L52) |
646
+ | $$$tokens$$$ `tokens` | `readonly` | `TTokens` | Derived token tree, same object as `environment.tokens`. | [engine.ts:50](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/engine.ts#L50) |
647
+
648
+ ***
649
+
650
+ ### DistilleryEnvironment [#distilleryenvironment-1]
651
+
652
+ Defined in: [environment.ts:43](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L43)
653
+
654
+ Resolved environment: derived `themeVars` / `tokens` plus the bind-time prefix and scope.
655
+
656
+ #### Type Parameters
657
+
658
+ | Type Parameter | Default type |
659
+ | ------ | ------ |
660
+ | `TTokens` | `unknown` |
661
+
662
+ #### Properties
663
+
664
+ | Property | Modifier | Type | Description | Defined in |
665
+ | ------ | ------ | ------ | ------ | ------ |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L45) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L51) |
668
+ | $$$themescope$$$ `themeScope` | `readonly` | `string` | Selector wrapping emitted theme-var declarations. | [environment.ts:47](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L47) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L49) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L53) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L55) |
672
+
673
+ ***
674
+
675
+ ### DistilleryOptions [#distilleryoptions]
676
+
677
+ Defined in: [environment.ts:27](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L27)
678
+
679
+ Authoring input to `createDistillery`.
680
+
681
+ #### Type Parameters
682
+
683
+ | Type Parameter | Default type |
684
+ | ------ | ------ |
685
+ | `TTheme` *extends* [`ThemeTree`](#themetree) | [`ThemeTree`](#themetree) |
686
+
687
+ #### Properties
688
+
689
+ | Property | Modifier | Type | Description | Defined in |
690
+ | ------ | ------ | ------ | ------ | ------ |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L39) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L29) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L37) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L33) |
695
+ | $$$themescope-1$$$ `themeScope` | `readonly` | `string` | Selector wrapping emitted theme-var declarations. | [environment.ts:31](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L31) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L35) |
697
+
698
+ ***
699
+
700
+ ### LocalVarDefaultMarker [#localvardefaultmarker]
701
+
702
+ Defined in: [local\_vars.ts:53](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L53)
703
+
704
+ Interpolation marker representing `${group}` defaults.
705
+
706
+ #### Properties
707
+
708
+ | Property | Modifier | Type | Description | Defined in |
709
+ | ------ | ------ | ------ | ------ | ------ |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L55) |
711
+ | $$$defaults$$$ `defaults` | `readonly` | readonly `object`[] | Ordered list of variable defaults. | [local\_vars.ts:61](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L61) |
712
+ | $$$groupid$$$ `groupId` | `readonly` | `string` | Unique ID for the group. | [local\_vars.ts:57](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L57) |
713
+ | $$$grouppath-1$$$ `groupPath` | `readonly` | `` `vars/${string}` `` | Group prefix path. | [local\_vars.ts:59](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L59) |
714
+
715
+ ***
716
+
717
+ ### LocalVarOverrideMarker [#localvaroverridemarker]
718
+
719
+ Defined in: [local\_vars.ts:34](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L34)
720
+
721
+ Interpolation marker representing `.set(...)` overrides.
722
+
723
+ #### Properties
724
+
725
+ | Property | Modifier | Type | Description | Defined in |
726
+ | ------ | ------ | ------ | ------ | ------ |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L36) |
728
+ | $$$groupid-1$$$ `groupId` | `readonly` | `string` | Unique ID for the group. | [local\_vars.ts:38](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L38) |
729
+ | $$$overrides$$$ `overrides` | `readonly` | readonly `object`[] | Ordered list of variable overrides. | [local\_vars.ts:40](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L40) |
730
+
731
+ ***
732
+
733
+ ### LocalVarRef [#localvarref]
734
+
735
+ Defined in: [local\_vars.ts:18](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L18)
736
+
737
+ Reference to a local CSS variable. Stringifies to `var(--...)`.
738
+
739
+ #### Properties
740
+
741
+ | Property | Modifier | Type | Description | Defined in |
742
+ | ------ | ------ | ------ | ------ | ------ |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L20) |
744
+ | $$$path-4$$$ `path` | `readonly` | `` `vars/${string}` `` | Canonical group/key path. | [local\_vars.ts:22](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L22) |
745
+ | $$$propname$$$ `propName` | `readonly` | `` `--${string}` `` | Actual emitted CSS custom property name. | [local\_vars.ts:24](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L24) |
746
+ | $$$ref-2$$$ `ref` | `readonly` | `` `var(--${string})` `` | Usable CSS `var(...)` reference string. | [local\_vars.ts:26](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L26) |
747
+
748
+ #### Methods
749
+
750
+ ##### \[toPrimitive\]() [#toprimitive-3]
751
+
752
+ ```ts
753
+ toPrimitive: string;
754
+ ```
755
+
756
+ Defined in: [local\_vars.ts:30](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L30)
757
+
758
+ Template interpolation; same as [LocalVarRef.toString](#tostring-3).
759
+
760
+ ###### Parameters
761
+
762
+ | Parameter | Type |
763
+ | ------ | ------ |
764
+ | `hint` | `string` |
765
+
766
+ ###### Returns
767
+
768
+ `string`
769
+
770
+ ##### toString() [#tostring-3]
771
+
772
+ ```ts
773
+ toString(): string;
774
+ ```
775
+
776
+ Defined in: [local\_vars.ts:28](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L28)
777
+
778
+ Stringifies to [LocalVarRef.ref](#ref-2).
779
+
780
+ ###### Returns
781
+
782
+ `string`
783
+
784
+ ***
785
+
786
+ ### MediaThemeVariation [#mediathemevariation]
787
+
788
+ Defined in: [theme.ts:89](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L89)
789
+
790
+ Media-conditioned variation. `media` is intrinsic; it is not a selector.
791
+
792
+ #### Type Parameters
793
+
794
+ | Type Parameter | Default type |
795
+ | ------ | ------ |
796
+ | `T` *extends* [`ThemeTree`](#themetree) | [`ThemeTree`](#themetree) |
797
+
798
+ #### Properties
799
+
800
+ | Property | Modifier | Type | Description | Defined in |
801
+ | ------ | ------ | ------ | ------ | ------ |
802
+ | $$$media$$$ `media` | `readonly` | `string` | Media query wrapping this variation's emitted diffs. | [theme.ts:91](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L91) |
803
+ | $$$variation$$$ `variation` | `readonly` | [`DeepPartialTheme`](#deeppartialtheme)\<`T`\> | Partial variation of the base theme. | [theme.ts:93](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L93) |
804
+
805
+ ***
806
+
807
+ ### PrimitiveStyleAuthoringApi [#primitivestyleauthoringapi]
808
+
809
+ Defined in: [styles/types.ts:278](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L278)
810
+
811
+ Narrow `t` for `primitiveStyles`: handles and tokens only.
812
+
813
+ #### Type Parameters
814
+
815
+ | Type Parameter | Default type |
816
+ | ------ | ------ |
817
+ | `TTokens` | `unknown` |
818
+
819
+ #### Properties
820
+
821
+ | Property | Type | Description | Defined in |
822
+ | ------ | ------ | ------ | ------ |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L280) |
824
+ | $$$tokens-2$$$ `tokens` | `TTokens` | Environment token tree. | [styles/types.ts:282](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L282) |
825
+
826
+ ***
827
+
828
+ ### RenderStylesOptions [#renderstylesoptions]
829
+
830
+ Defined in: [runtime.ts:67](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/runtime.ts#L67)
831
+
832
+ Per-render variation selection, scheme flatten, alternate blocks, and value overrides.
833
+
834
+ #### Properties
835
+
836
+ | Property | Type | Description | Defined in |
837
+ | ------ | ------ | ------ | ------ |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/runtime.ts#L77) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/runtime.ts#L69) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/runtime.ts#L75) |
841
+ | $$$themevalueoverrides$$$ `themeValueOverrides?` | `Partial`\<`Record`\<`string`, `string`\>\> | Override a theme token's emitted value. | [runtime.ts:79](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/runtime.ts#L79) |
842
+
843
+ ***
844
+
845
+ ### ResolvedThemeVariation [#resolvedthemevariation]
846
+
847
+ Defined in: [theme.ts:101](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L101)
848
+
849
+ One named variation resolved against the base at construction.
850
+
851
+ #### Properties
852
+
853
+ | Property | Modifier | Type | Description | Defined in |
854
+ | ------ | ------ | ------ | ------ | ------ |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L109) |
856
+ | $$$media-1$$$ `media?` | `readonly` | `string` | Intrinsic media query, when declared. | [theme.ts:105](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L105) |
857
+ | $$$name-2$$$ `name` | `readonly` | `string` | Name passed in `variations`. | [theme.ts:103](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L103) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L107) |
859
+
860
+ ***
861
+
862
+ ### RuleOptions [#ruleoptions]
863
+
864
+ Defined in: [styles/types.ts:148](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L148)
865
+
866
+ Options for [rule](#rule).
867
+
868
+ #### Properties
869
+
870
+ | Property | Type | Description | Defined in |
871
+ | ------ | ------ | ------ | ------ |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L150) |
873
+
874
+ ***
875
+
876
+ ### ScaleToken [#scaletoken]
877
+
878
+ Defined in: [tokens/scale\_token.ts:11](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/scale_token.ts#L11)
879
+
880
+ Represents a CSS scale size token. Stringifies to its literal value.
881
+
882
+ #### Properties
883
+
884
+ | Property | Modifier | Type | Description | Defined in |
885
+ | ------ | ------ | ------ | ------ | ------ |
886
+ | $$$__kind-6$$$ `__kind` | `readonly` | `"scale-token"` | Brand for [isScaleToken](#isscaletoken). | [tokens/scale\_token.ts:13](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/scale_token.ts#L13) |
887
+ | $$$cq$$$ `cq` | `readonly` | `string` | Container-query-relative variant of `value`. | [tokens/scale\_token.ts:17](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/scale_token.ts#L17) |
888
+ | $$$value$$$ `value` | `readonly` | `string` | Literal CSS value, inlined into declarations. | [tokens/scale\_token.ts:15](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/scale_token.ts#L15) |
889
+
890
+ #### Methods
891
+
892
+ ##### \[toPrimitive\]() [#toprimitive-4]
893
+
894
+ ```ts
895
+ toPrimitive: string;
896
+ ```
897
+
898
+ Defined in: [tokens/scale\_token.ts:21](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/scale_token.ts#L21)
899
+
900
+ Template interpolation; same as [ScaleToken.toString](#tostring-4).
901
+
902
+ ###### Parameters
903
+
904
+ | Parameter | Type |
905
+ | ------ | ------ |
906
+ | `hint` | `string` |
907
+
908
+ ###### Returns
909
+
910
+ `string`
911
+
912
+ ##### toString() [#tostring-4]
913
+
914
+ ```ts
915
+ toString(): string;
916
+ ```
917
+
918
+ Defined in: [tokens/scale\_token.ts:19](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/scale_token.ts#L19)
919
+
920
+ Stringifies to [ScaleToken.value](#value).
921
+
922
+ ###### Returns
923
+
924
+ `string`
925
+
926
+ ***
927
+
928
+ ### SchemePair [#schemepair]
929
+
930
+ Defined in: [tokens/light\_dark.ts:11](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/light_dark.ts#L11)
931
+
932
+ Scheme-varying color pair. Compiles to `light-dark(light, dark)`.
933
+
934
+ #### Properties
935
+
936
+ | Property | Modifier | Type | Description | Defined in |
937
+ | ------ | ------ | ------ | ------ | ------ |
938
+ | $$$__kind-7$$$ `__kind` | `readonly` | `"scheme-pair"` | Brand for isSchemePair. | [tokens/light\_dark.ts:13](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/light_dark.ts#L13) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/light_dark.ts#L17) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/light_dark.ts#L15) |
941
+
942
+ ***
943
+
944
+ ### StyleAuthoringApi [#styleauthoringapi]
945
+
946
+ Defined in: [styles/types.ts:219](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L219)
947
+
948
+ Authoring API passed to `createStyleModule` factories.
949
+
950
+ #### Type Parameters
951
+
952
+ | Type Parameter | Default type |
953
+ | ------ | ------ |
954
+ | `TTokens` | `unknown` |
955
+
956
+ #### Properties
957
+
958
+ | Property | Type | Description | Defined in |
959
+ | ------ | ------ | ------ | ------ |
960
+ | $$$css-1$$$ `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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L221) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L226) |
962
+ | $$$tokens-3$$$ `tokens` | `TTokens` | Environment token tree. | [styles/types.ts:236](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L236) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L231) |
964
+
965
+ ***
966
+
967
+ ### StyleDeps [#styledeps]
968
+
969
+ Defined in: [styles/types.ts:47](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L47)
970
+
971
+ Reachability sets captured while authoring a declaration block.
972
+
973
+ #### Properties
974
+
975
+ | Property | Modifier | Type | Description | Defined in |
976
+ | ------ | ------ | ------ | ------ | ------ |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L55) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L53) |
979
+ | $$$theme-1$$$ `theme` | `readonly` | `ReadonlySet`\<`string`\> | Theme-token paths interpolated into this block. | [styles/types.ts:49](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L49) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L51) |
981
+
982
+ ***
983
+
984
+ ### StyleHandle [#stylehandle]
985
+
986
+ Defined in: [styles/types.ts:105](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L105)
987
+
988
+ A named class: readable name, declarations, and collection identity.
989
+
990
+ #### Extended by
991
+
992
+ - [`EmotionCss`](emotion.md#emotioncss-1)
993
+
994
+ #### Properties
995
+
996
+ | Property | Modifier | Type | Description | Defined in |
997
+ | ------ | ------ | ------ | ------ | ------ |
998
+ | $$$declarations-1$$$ `declarations` | `readonly` | [`Declarations`](#declarations) | CSS properties for this handle. | [styles/types.ts:117](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L117) |
999
+ | $$$key-1$$$ `key` | `readonly` | `string` | Full path joined by dots. | [styles/types.ts:113](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L113) |
1000
+ | $$$kind$$$ `kind` | `readonly` | `"handle"` | Discriminant for [StyleEntry](#styleentry). | [styles/types.ts:107](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L107) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L111) |
1002
+ | $$$modulename$$$ `moduleName` | `readonly` | `string` | The registered module name this handle belongs to. | [styles/types.ts:109](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L109) |
1003
+ | $$$readablename$$$ `readableName` | `readonly` | `string` | Predictable name used for output CSS classes. | [styles/types.ts:115](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L115) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L119) |
1005
+
1006
+ #### Methods
1007
+
1008
+ ##### resolveClassName() [#resolveclassname]
1009
+
1010
+ ```ts
1011
+ resolveClassName(context): string;
1012
+ ```
1013
+
1014
+ Defined in: [styles/types.ts:121](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L121)
1015
+
1016
+ Produces the final class name via the provided resolver context.
1017
+
1018
+ ###### Parameters
1019
+
1020
+ | Parameter | Type | Description |
1021
+ | ------ | ------ | ------ |
1022
+ | `context` | \{ `resolveClassName`: (...`handles`) => `string`; \} | - |
1023
+ | `context.resolveClassName` | (...`handles`) => `string` | Joins one or more handles into a class-name string. |
1024
+
1025
+ ###### Returns
1026
+
1027
+ `string`
1028
+
1029
+ ***
1030
+
1031
+ ### StyleMedia [#stylemedia]
1032
+
1033
+ Defined in: [styles/types.ts:154](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L154)
1034
+
1035
+ `@media` or `@container` block wrapping inner [StyleRule](#stylerule)s.
1036
+
1037
+ #### Properties
1038
+
1039
+ | Property | Modifier | Type | Description | Defined in |
1040
+ | ------ | ------ | ------ | ------ | ------ |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L160) |
1042
+ | $$$key-2$$$ `key` | `readonly` | `string` | Stable identity for deduplication across multiple renders. | [styles/types.ts:162](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L162) |
1043
+ | $$$kind-1$$$ `kind` | `readonly` | `"media"` | Discriminant for [StyleEntry](#styleentry). | [styles/types.ts:156](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L156) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L164) |
1045
+ | $$$query$$$ `query` | `readonly` | `string` | The conditional query (e.g. `(min-width: 600px)`). | [styles/types.ts:166](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L166) |
1046
+ | $$$rules$$$ `rules` | `readonly` | readonly [`StyleRule`](#stylerule)[] | Inner rules collected inside this block. | [styles/types.ts:168](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L168) |
1047
+ | $$$variant-1$$$ `variant` | `readonly` | `boolean` | `true` when produced inside `variants(...)`. | [styles/types.ts:170](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L170) |
1048
+
1049
+ ***
1050
+
1051
+ ### StyleNameResolver [#stylenameresolver]
1052
+
1053
+ Defined in: [names.ts:14](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/names.ts#L14)
1054
+
1055
+ Context for resolving keys into final class or custom-property names.
1056
+
1057
+ #### Properties
1058
+
1059
+ | Property | Modifier | Type | Description | Defined in |
1060
+ | ------ | ------ | ------ | ------ | ------ |
1061
+ | $$$names-1$$$ `names` | `readonly` | [`StyleNameMode`](#stylenamemode) | The naming mode used by this resolver. | [names.ts:16](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/names.ts#L16) |
1062
+
1063
+ #### Methods
1064
+
1065
+ ##### className() [#classname]
1066
+
1067
+ ```ts
1068
+ className(key, readableName?): string;
1069
+ ```
1070
+
1071
+ Defined in: [names.ts:18](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/names.ts#L18)
1072
+
1073
+ Resolves a handle key into a CSS class name.
1074
+
1075
+ ###### Parameters
1076
+
1077
+ | Parameter | Type |
1078
+ | ------ | ------ |
1079
+ | `key` | `string` |
1080
+ | `readableName?` | `string` |
1081
+
1082
+ ###### Returns
1083
+
1084
+ `string`
1085
+
1086
+ ##### cssVar() [#cssvar-1]
1087
+
1088
+ ```ts
1089
+ cssVar(key): `--${string}`;
1090
+ ```
1091
+
1092
+ Defined in: [names.ts:20](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/names.ts#L20)
1093
+
1094
+ Resolves a variable key into a custom property name.
1095
+
1096
+ ###### Parameters
1097
+
1098
+ | Parameter | Type |
1099
+ | ------ | ------ |
1100
+ | `key` | `string` |
1101
+
1102
+ ###### Returns
1103
+
1104
+ `` `--${string}` ``
1105
+
1106
+ ##### cssVarRef() [#cssvarref]
1107
+
1108
+ ```ts
1109
+ cssVarRef(key): `var(--${string})`;
1110
+ ```
1111
+
1112
+ Defined in: [names.ts:22](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/names.ts#L22)
1113
+
1114
+ Resolves a variable key into a `var(...)` reference.
1115
+
1116
+ ###### Parameters
1117
+
1118
+ | Parameter | Type |
1119
+ | ------ | ------ |
1120
+ | `key` | `string` |
1121
+
1122
+ ###### Returns
1123
+
1124
+ `` `var(--${string})` ``
1125
+
1126
+ ***
1127
+
1128
+ ### StyleNameResolverOptions [#stylenameresolveroptions]
1129
+
1130
+ Defined in: [names.ts:26](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/names.ts#L26)
1131
+
1132
+ Inputs for [createStyleNameResolver](#createstylenameresolver).
1133
+
1134
+ #### Properties
1135
+
1136
+ | Property | Type | Description | Defined in |
1137
+ | ------ | ------ | ------ | ------ |
1138
+ | $$$classkeys-1$$$ `classKeys?` | `Iterable`\<`string`, `any`, `any`\> | Keys defining the compact class-name domain. | [names.ts:32](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/names.ts#L32) |
1139
+ | $$$cssvarkeys-1$$$ `cssVarKeys?` | `Iterable`\<`string`, `any`, `any`\> | Keys defining the compact custom-property domain. | [names.ts:34](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/names.ts#L34) |
1140
+ | $$$names-2$$$ `names` | [`StyleNameMode`](#stylenamemode) | Naming strategy (`compact` or `readable`). | [names.ts:28](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/names.ts#L28) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/names.ts#L30) |
1142
+
1143
+ ***
1144
+
1145
+ ### StyleRegistrySnapshot [#styleregistrysnapshot]
1146
+
1147
+ Defined in: [styles/types.ts:198](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L198)
1148
+
1149
+ Class and CSS-var key snapshot used to build a [StyleNameResolver](#stylenameresolver).
1150
+
1151
+ #### Properties
1152
+
1153
+ | Property | Modifier | Type | Description | Defined in |
1154
+ | ------ | ------ | ------ | ------ | ------ |
1155
+ | $$$classkeys-2$$$ `classKeys` | `readonly` | readonly `string`[] | Collected readable class names from registered modules. | [styles/types.ts:200](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L200) |
1156
+ | $$$cssvarkeys-2$$$ `cssVarKeys` | `readonly` | readonly `string`[] | Collected custom property (CSS variable) keys. | [styles/types.ts:202](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L202) |
1157
+
1158
+ ***
1159
+
1160
+ ### StyleRule [#stylerule]
1161
+
1162
+ Defined in: [styles/types.ts:128](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L128)
1163
+
1164
+ A selector plus declarations, optionally auto-collected from handle deps.
1165
+
1166
+ #### Properties
1167
+
1168
+ | Property | Modifier | Type | Description | Defined in |
1169
+ | ------ | ------ | ------ | ------ | ------ |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L144) |
1171
+ | $$$declarations-2$$$ `declarations` | `readonly` | [`Declarations`](#declarations) | CSS properties for this rule. | [styles/types.ts:138](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L138) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L142) |
1173
+ | $$$key-3$$$ `key` | `readonly` | `string` | Unique key for this rule within the module. | [styles/types.ts:134](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L134) |
1174
+ | $$$kind-2$$$ `kind` | `readonly` | `"rule"` | Discriminant for [StyleEntry](#styleentry). | [styles/types.ts:130](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L130) |
1175
+ | $$$modulename-2$$$ `moduleName` | `readonly` | `string` | The registered module name this rule belongs to. | [styles/types.ts:132](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L132) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L136) |
1177
+ | $$$variant-2$$$ `variant` | `readonly` | `boolean` | `true` when produced inside `variants(...)`. | [styles/types.ts:140](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L140) |
1178
+
1179
+ ***
1180
+
1181
+ ### StylesCollectorOptions [#stylescollectoroptions]
1182
+
1183
+ Defined in: [collector.ts:85](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L85)
1184
+
1185
+ Target, naming mode, registry, and prefix for one [StylesCollector](#stylescollector).
1186
+
1187
+ #### Properties
1188
+
1189
+ | Property | Type | Description | Defined in |
1190
+ | ------ | ------ | ------ | ------ |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L95) |
1192
+ | $$$names-3$$$ `names` | [`StyleNameMode`](#stylenamemode) | Desired name mode (`compact` or `readable`). | [collector.ts:89](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L89) |
1193
+ | $$$prefix-4$$$ `prefix` | `string` | Brand prefix forwarded to the name resolver. | [collector.ts:93](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L93) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L91) |
1195
+ | $$$target-1$$$ `target` | [`StyleTarget`](#styletarget) | Target context (e.g. `artifact` or `stylesheet`). | [collector.ts:87](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L87) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/collector.ts#L97) |
1197
+
1198
+ ***
1199
+
1200
+ ### StylesModule [#stylesmodule]
1201
+
1202
+ Defined in: [styles/types.ts:180](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L180)
1203
+
1204
+ Named handle tree plus flat entries after `createStyleModule`.
1205
+
1206
+ #### Type Parameters
1207
+
1208
+ | Type Parameter | Default type |
1209
+ | ------ | ------ |
1210
+ | `TStyles` | [`StylesObject`](#stylesobject) |
1211
+
1212
+ #### Properties
1213
+
1214
+ | Property | Modifier | Type | Description | Defined in |
1215
+ | ------ | ------ | ------ | ------ | ------ |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L186) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L188) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L184) |
1219
+ | $$$name-3$$$ `name` | `readonly` | `string` | The unique registered name of the module. | [styles/types.ts:182](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L182) |
1220
+ | $$$themedeps$$$ `themeDeps` | `readonly` | `ReadonlySet`\<`string`\> | Aggregated theme dependencies across all entries. | [styles/types.ts:190](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L190) |
1221
+ | $$$vardeps$$$ `varDeps` | `readonly` | `ReadonlySet`\<`` `vars/${string}` ``\> | Aggregated variable dependencies across all entries. | [styles/types.ts:192](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L192) |
1222
+
1223
+ ***
1224
+
1225
+ ### ThemeAlternate [#themealternate]
1226
+
1227
+ Defined in: [runtime.ts:83](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/runtime.ts#L83)
1228
+
1229
+ One runtime-switched variation. `selector` is required unless the variation declares `media`.
1230
+
1231
+ #### Properties
1232
+
1233
+ | Property | Modifier | Type | Description | Defined in |
1234
+ | ------ | ------ | ------ | ------ | ------ |
1235
+ | $$$selector-1$$$ `selector?` | `readonly` | `string` | Consuming page selector, composed with `themeScope`. | [runtime.ts:87](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/runtime.ts#L87) |
1236
+ | $$$variation-1$$$ `variation` | `readonly` | `string` | Name passed in `DistilleryOptions.variations`. | [runtime.ts:85](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/runtime.ts#L85) |
1237
+
1238
+ ***
1239
+
1240
+ ### ThemeVarDefinition [#themevardefinition]
1241
+
1242
+ Defined in: [environment.ts:15](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L15)
1243
+
1244
+ One theme CSS variable. Differing `light`/`dark` fold into `light-dark(...)`.
1245
+
1246
+ #### Properties
1247
+
1248
+ | Property | Modifier | Type | Description | Defined in |
1249
+ | ------ | ------ | ------ | ------ | ------ |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L19) |
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/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L23) |
1252
+ | $$$light-1$$$ `light` | `readonly` | `string` | Value for light color scheme. | [environment.ts:21](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L21) |
1253
+ | $$$path-5$$$ `path` | `readonly` | `string` | Theme-tree path this definition was derived from. | [environment.ts:17](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/environment.ts#L17) |
1254
+
1255
+ ## Type Aliases
1256
+
1257
+ ### ContextualVarPath [#contextualvarpath]
1258
+
1259
+ ```ts
1260
+ type ContextualVarPath = `vars/${string}`;
1261
+ ```
1262
+
1263
+ Defined in: [styles/types.ts:32](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L32)
1264
+
1265
+ Canonical `vars/<group>/<key>` path for a contextual or module-local CSS variable.
1266
+
1267
+ ***
1268
+
1269
+ ### CssValue [#cssvalue]
1270
+
1271
+ ```ts
1272
+ type CssValue =
1273
+ | string
1274
+ | number
1275
+ | CssToken
1276
+ | ContextualCssVar
1277
+ | ContextualCssVarName
1278
+ | ScaleToken
1279
+ | LocalVarRef;
1280
+ ```
1281
+
1282
+ Defined in: [styles/types.ts:37](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L37)
1283
+
1284
+ Values accepted by `t.vars(...)` defaults and `.set(...)`.
1285
+
1286
+ ***
1287
+
1288
+ ### CssVarPath [#cssvarpath]
1289
+
1290
+ ```ts
1291
+ type CssVarPath = string;
1292
+ ```
1293
+
1294
+ Defined in: [styles/types.ts:34](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L34)
1295
+
1296
+ Theme-token path or any other CSS-var key the resolver knows.
1297
+
1298
+ ***
1299
+
1300
+ ### DeclarationSegment [#declarationsegment]
1301
+
1302
+ ```ts
1303
+ type DeclarationSegment = string | LocalVarMarker;
1304
+ ```
1305
+
1306
+ Defined in: [styles/types.ts:94](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L94)
1307
+
1308
+ Literal CSS text or a local-var interpolation marker.
1309
+
1310
+ ***
1311
+
1312
+ ### DeepPartialTheme [#deeppartialtheme]
1313
+
1314
+ ```ts
1315
+ 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
+ ```
1317
+
1318
+ Defined in: [theme.ts:80](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L80)
1319
+
1320
+ Partial variation of a [ThemeTree](#themetree). Leaves may change kind between `string` and [SchemePair](#schemepair).
1321
+
1322
+ #### Type Parameters
1323
+
1324
+ | Type Parameter |
1325
+ | ------ |
1326
+ | `T` |
1327
+
1328
+ ***
1329
+
1330
+ ### LocalVarGroup [#localvargroup]
1331
+
1332
+ ```ts
1333
+ type LocalVarGroup<TKey> = { readonly [P in TKey]: LocalVarRef } & object;
1334
+ ```
1335
+
1336
+ Defined in: [local\_vars.ts:79](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L79)
1337
+
1338
+ Value returned by `t.vars(...)`. Interpolate `${group}`, `${group.key}`, or `${group.set({...})}`.
1339
+
1340
+ #### Type Declaration
1341
+
1342
+ ##### set()
1343
+
1344
+ ```ts
1345
+ set(overrides): LocalVarOverrideMarker;
1346
+ ```
1347
+
1348
+ Builds a marker that writes the given keys at the interpolation site.
1349
+
1350
+ ###### Parameters
1351
+
1352
+ | Parameter | Type |
1353
+ | ------ | ------ |
1354
+ | `overrides` | `Partial`\<`Record`\<`TKey`, [`CssValue`](#cssvalue)\>\> |
1355
+
1356
+ ###### Returns
1357
+
1358
+ [`LocalVarOverrideMarker`](#localvaroverridemarker)
1359
+
1360
+ #### Type Parameters
1361
+
1362
+ | Type Parameter |
1363
+ | ------ |
1364
+ | `TKey` *extends* `string` |
1365
+
1366
+ ***
1367
+
1368
+ ### LocalVarMarker [#localvarmarker]
1369
+
1370
+ ```ts
1371
+ type LocalVarMarker =
1372
+ | LocalVarOverrideMarker
1373
+ | LocalVarDefaultMarker;
1374
+ ```
1375
+
1376
+ Defined in: [local\_vars.ts:74](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/local_vars.ts#L74)
1377
+
1378
+ Interpolation marker: `${group}` defaults or `${group.set(...)}` overrides.
1379
+
1380
+ ***
1381
+
1382
+ ### PathsOf [#pathsof]
1383
+
1384
+ ```ts
1385
+ 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
+ ```
1387
+
1388
+ Defined in: [theme.ts:55](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L55)
1389
+
1390
+ Slash-delimited theme-var paths (excludes [ScaleToken](#scaletoken) leaves).
1391
+
1392
+ #### Type Parameters
1393
+
1394
+ | Type Parameter | Default type |
1395
+ | ------ | ------ |
1396
+ | `T` | - |
1397
+ | `Prefix` *extends* `string` | `""` |
1398
+
1399
+ ***
1400
+
1401
+ ### ResolvedStyles [#resolvedstyles]
1402
+
1403
+ ```ts
1404
+ 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
+ ```
1406
+
1407
+ Defined in: [styles/types.ts:206](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L206)
1408
+
1409
+ Resolves nested pending handles, rules, and medias into their runtime types.
1410
+
1411
+ #### Type Parameters
1412
+
1413
+ | Type Parameter |
1414
+ | ------ |
1415
+ | `TValue` |
1416
+
1417
+ ***
1418
+
1419
+ ### SchemeValueTree [#schemevaluetree]
1420
+
1421
+ ```ts
1422
+ type SchemeValueTree = object;
1423
+ ```
1424
+
1425
+ Defined in: [theme.ts:32](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L32)
1426
+
1427
+ Per-scheme value tree accepted by [zipSchemes](#zipschemes).
1428
+
1429
+ #### Index Signature
1430
+
1431
+ ```ts
1432
+ [key: string]:
1433
+ | string
1434
+ | ScaleToken
1435
+ | SchemeValueTree
1436
+ ```
1437
+
1438
+ ***
1439
+
1440
+ ### StyleEntry [#styleentry]
1441
+
1442
+ ```ts
1443
+ type StyleEntry =
1444
+ | StyleHandle
1445
+ | StyleRule
1446
+ | StyleMedia;
1447
+ ```
1448
+
1449
+ Defined in: [styles/types.ts:174](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L174)
1450
+
1451
+ One registered handle, selector rule, or at-rule block.
1452
+
1453
+ ***
1454
+
1455
+ ### StyleNameMode [#stylenamemode]
1456
+
1457
+ ```ts
1458
+ type StyleNameMode = "compact" | "readable";
1459
+ ```
1460
+
1461
+ Defined in: [names.ts:9](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/names.ts#L9)
1462
+
1463
+ Naming scheme: `compact` assigns sequential identifiers by sorted key index, `readable` emits descriptive ones.
1464
+
1465
+ ***
1466
+
1467
+ ### StyleSelectorResolver [#styleselectorresolver]
1468
+
1469
+ ```ts
1470
+ type StyleSelectorResolver = (handle) => string & Record<string, string>;
1471
+ ```
1472
+
1473
+ Defined in: [styles/types.ts:176](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L176)
1474
+
1475
+ Selector factory: call with a handle, or read sibling local names as `.class` strings.
1476
+
1477
+ ***
1478
+
1479
+ ### StylesObject [#stylesobject]
1480
+
1481
+ ```ts
1482
+ type StylesObject = Record<string, unknown>;
1483
+ ```
1484
+
1485
+ Defined in: [styles/types.ts:196](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/types.ts#L196)
1486
+
1487
+ Authored module tree before [ResolvedStyles](#resolvedstyles) substitution.
1488
+
1489
+ ***
1490
+
1491
+ ### StyleTarget [#styletarget]
1492
+
1493
+ ```ts
1494
+ type StyleTarget = "artifact" | "stylesheet";
1495
+ ```
1496
+
1497
+ Defined in: [names.ts:11](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/names.ts#L11)
1498
+
1499
+ Destination format for the CSS collection.
1500
+
1501
+ ***
1502
+
1503
+ ### ThemeTree [#themetree]
1504
+
1505
+ ```ts
1506
+ type ThemeTree = object;
1507
+ ```
1508
+
1509
+ Defined in: [theme.ts:27](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L27)
1510
+
1511
+ Nested authoring tree. Keys must match `/^[A-Za-z_][A-Za-z0-9_]*$/`.
1512
+
1513
+ #### Index Signature
1514
+
1515
+ ```ts
1516
+ [key: string]: ThemeLeaf | ThemeTree
1517
+ ```
1518
+
1519
+ ***
1520
+
1521
+ ### ThemeVariation [#themevariation]
1522
+
1523
+ ```ts
1524
+ type ThemeVariation<T> =
1525
+ | DeepPartialTheme<T>
1526
+ | MediaThemeVariation<T>;
1527
+ ```
1528
+
1529
+ Defined in: [theme.ts:97](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L97)
1530
+
1531
+ Named variation: a partial of the base, or a media-conditioned partial.
1532
+
1533
+ #### Type Parameters
1534
+
1535
+ | Type Parameter | Default type |
1536
+ | ------ | ------ |
1537
+ | `T` *extends* [`ThemeTree`](#themetree) | [`ThemeTree`](#themetree) |
1538
+
1539
+ ***
1540
+
1541
+ ### TokensOf [#tokensof]
1542
+
1543
+ ```ts
1544
+ 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
+ ```
1546
+
1547
+ Defined in: [theme.ts:37](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L37)
1548
+
1549
+ Token tree derived from an authoring [ThemeTree](#themetree).
1550
+
1551
+ #### Type Parameters
1552
+
1553
+ | Type Parameter |
1554
+ | ------ |
1555
+ | `T` |
1556
+
1557
+ ***
1558
+
1559
+ ### ValuesOf [#valuesof]
1560
+
1561
+ ```ts
1562
+ 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
+ ```
1564
+
1565
+ Defined in: [theme.ts:46](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L46)
1566
+
1567
+ Literal-value tree for one scheme. [ScaleToken](#scaletoken) leaves use `.value`.
1568
+
1569
+ #### Type Parameters
1570
+
1571
+ | Type Parameter |
1572
+ | ------ |
1573
+ | `T` |
1574
+
1575
+ ***
1576
+
1577
+ ### Zipped [#zipped]
1578
+
1579
+ ```ts
1580
+ 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
+ ```
1582
+
1583
+ Defined in: [theme.ts:71](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L71)
1584
+
1585
+ [zipSchemes](#zipschemes) output: equal strings collapse; differing strings become [SchemePair](#schemepair).
1586
+
1587
+ #### Type Parameters
1588
+
1589
+ | Type Parameter |
1590
+ | ------ |
1591
+ | `T` |
1592
+
1593
+ ## Variables
1594
+
1595
+ ### cq [#cq-1]
1596
+
1597
+ ```ts
1598
+ const cq: (value, cq) => ScaleToken = scaleToken;
1599
+ ```
1600
+
1601
+ Defined in: [tokens/scale\_token.ts:37](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/scale_token.ts#L37)
1602
+
1603
+ Alias of [scaleToken](#scaletoken-1) for theme-tree authoring.
1604
+
1605
+ Literal size token. Stringifies to `value`; `cq` is the container-relative variant.
1606
+
1607
+ #### Parameters
1608
+
1609
+ | Parameter | Type |
1610
+ | ------ | ------ |
1611
+ | `value` | `string` |
1612
+ | `cq` | `string` |
1613
+
1614
+ #### Returns
1615
+
1616
+ [`ScaleToken`](#scaletoken)
1617
+
1618
+ ## Functions
1619
+
1620
+ ### combineClassNames() [#combineclassnames]
1621
+
1622
+ ```ts
1623
+ function combineClassNames(context, ...handles): string;
1624
+ ```
1625
+
1626
+ Defined in: [styles/authoring.ts:203](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/authoring.ts#L203)
1627
+
1628
+ Resolves handles through the collector's class-name resolver.
1629
+
1630
+ #### Parameters
1631
+
1632
+ | Parameter | Type | Description |
1633
+ | ------ | ------ | ------ |
1634
+ | `context` | \{ `resolveClassName`: (...`handles`) => `string`; \} | Object exposing `resolveClassName` (e.g. a React render context). |
1635
+ | `context.resolveClassName` | (...`handles`) => `string` | - |
1636
+ | ...`handles` | readonly [`StyleHandle`](#stylehandle)[] | One or more handles to resolve and join. |
1637
+
1638
+ #### Returns
1639
+
1640
+ `string`
1641
+
1642
+ ***
1643
+
1644
+ ### container() [#container]
1645
+
1646
+ ```ts
1647
+ function container(query, rules): StyleMedia;
1648
+ ```
1649
+
1650
+ Defined in: [styles/authoring.ts:140](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/authoring.ts#L140)
1651
+
1652
+ `@container` block. `kind` stays `'media'` so emission rank matches [media](#media-2).
1653
+
1654
+ #### Parameters
1655
+
1656
+ | Parameter | Type | Description |
1657
+ | ------ | ------ | ------ |
1658
+ | `query` | `string` | Container query string (e.g. `(min-width: 400px)`). |
1659
+ | `rules` | readonly [`StyleRule`](#stylerule)[] | Inner rules scoped to this block. |
1660
+
1661
+ #### Returns
1662
+
1663
+ [`StyleMedia`](#stylemedia)
1664
+
1665
+ ***
1666
+
1667
+ ### contextualVar() [#contextualvar]
1668
+
1669
+ ```ts
1670
+ function contextualVar(path, prop): ContextualCssVar;
1671
+ ```
1672
+
1673
+ Defined in: [tokens/contextual\_var.ts:41](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L41)
1674
+
1675
+ Shared contextual var. Stringifies to `var(<prop>)`; `.name` is the ident.
1676
+
1677
+ #### Parameters
1678
+
1679
+ | Parameter | Type |
1680
+ | ------ | ------ |
1681
+ | `path` | `` `vars/${string}` `` |
1682
+ | `prop` | `` `--${string}` `` |
1683
+
1684
+ #### Returns
1685
+
1686
+ [`ContextualCssVar`](#contextualcssvar)
1687
+
1688
+ ***
1689
+
1690
+ ### createDistillery() [#createdistillery]
1691
+
1692
+ ```ts
1693
+ function createDistillery<TTheme>(options): Distillery<TokensOf<TTheme>, TTheme>;
1694
+ ```
1695
+
1696
+ Defined in: [engine.ts:100](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/engine.ts#L100)
1697
+
1698
+ Binds the engine to one library's prefix and theme tree.
1699
+
1700
+ #### Type Parameters
1701
+
1702
+ | Type Parameter |
1703
+ | ------ |
1704
+ | `TTheme` *extends* [`ThemeTree`](#themetree) |
1705
+
1706
+ #### Parameters
1707
+
1708
+ | Parameter | Type | Description |
1709
+ | ------ | ------ | ------ |
1710
+ | `options` | [`DistilleryOptions`](#distilleryoptions)\<`TTheme`\> | Brand prefix, theme scope, and authoring theme tree. |
1711
+
1712
+ #### Returns
1713
+
1714
+ [`Distillery`](#distillery)\<[`TokensOf`](#tokensof)\<`TTheme`\>, `TTheme`\>
1715
+
1716
+ #### Throws
1717
+
1718
+ If `prefix` is not a CSS identifier segment, if a theme key contains a hyphen, if a `lightDark` value is not a CSS `<color>`, if a named variation disagrees with the base, or if `themeVars` / `sharedVars` claim the same readable custom-property name.
1719
+
1720
+ ***
1721
+
1722
+ ### createStyleNameResolver() [#createstylenameresolver]
1723
+
1724
+ ```ts
1725
+ function createStyleNameResolver(__namedParameters): StyleNameResolver;
1726
+ ```
1727
+
1728
+ Defined in: [names.ts:102](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/names.ts#L102)
1729
+
1730
+ Maps semantic keys to readable (`<prefix>-<key>`) or compact (`a`, `b`, …) names.
1731
+
1732
+ #### Parameters
1733
+
1734
+ | Parameter | Type |
1735
+ | ------ | ------ |
1736
+ | `__namedParameters` | [`StyleNameResolverOptions`](#stylenameresolveroptions) |
1737
+
1738
+ #### Returns
1739
+
1740
+ [`StyleNameResolver`](#stylenameresolver)
1741
+
1742
+ ***
1743
+
1744
+ ### css() [#css-2]
1745
+
1746
+ ```ts
1747
+ function css(strings, ...values): PendingStyleHandle;
1748
+ ```
1749
+
1750
+ Defined in: [styles/authoring.ts:37](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/authoring.ts#L37)
1751
+
1752
+ Handle template. Nested `&` / `@media` flatten into sibling rules.
1753
+
1754
+ #### Parameters
1755
+
1756
+ | Parameter | Type |
1757
+ | ------ | ------ |
1758
+ | `strings` | `TemplateStringsArray` |
1759
+ | ...`values` | readonly `unknown`[] |
1760
+
1761
+ #### Returns
1762
+
1763
+ `PendingStyleHandle`
1764
+
1765
+ ***
1766
+
1767
+ ### cssVarName() [#cssvarname]
1768
+
1769
+ ```ts
1770
+ function cssVarName(prefix, path): `--${string}`;
1771
+ ```
1772
+
1773
+ Defined in: [names.ts:86](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/names.ts#L86)
1774
+
1775
+ Readable custom-property name: `--${prefix}-${path}` with `/` joined on `-` and a leading `vars/` stripped.
1776
+
1777
+ #### Parameters
1778
+
1779
+ | Parameter | Type | Description |
1780
+ | ------ | ------ | ------ |
1781
+ | `prefix` | `string` | Brand prefix (e.g. `'eui'`). |
1782
+ | `path` | `string` | Theme or contextual-var path (e.g. `'colors/ink'`, `'vars/chip/look/bg'`). |
1783
+
1784
+ #### Returns
1785
+
1786
+ `` `--${string}` ``
1787
+
1788
+ ***
1789
+
1790
+ ### decls() [#decls-1]
1791
+
1792
+ ```ts
1793
+ function decls(strings, ...values): Declarations;
1794
+ ```
1795
+
1796
+ Defined in: [styles/authoring.ts:31](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/authoring.ts#L31)
1797
+
1798
+ Declaration-block template. Interpolations stringify; local-var markers stay until render.
1799
+
1800
+ #### Parameters
1801
+
1802
+ | Parameter | Type |
1803
+ | ------ | ------ |
1804
+ | `strings` | `TemplateStringsArray` |
1805
+ | ...`values` | readonly `unknown`[] |
1806
+
1807
+ #### Returns
1808
+
1809
+ [`Declarations`](#declarations)
1810
+
1811
+ ***
1812
+
1813
+ ### isContextualCssVar() [#iscontextualcssvar]
1814
+
1815
+ ```ts
1816
+ function isContextualCssVar(value): value is ContextualCssVar;
1817
+ ```
1818
+
1819
+ Defined in: [tokens/contextual\_var.ts:66](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L66)
1820
+
1821
+ `true` when `value` is a [ContextualCssVar](#contextualcssvar).
1822
+
1823
+ #### Parameters
1824
+
1825
+ | Parameter | Type | Description |
1826
+ | ------ | ------ | ------ |
1827
+ | `value` | `unknown` | Value to test. |
1828
+
1829
+ #### Returns
1830
+
1831
+ `value is ContextualCssVar`
1832
+
1833
+ ***
1834
+
1835
+ ### isContextualCssVarName() [#iscontextualcssvarname]
1836
+
1837
+ ```ts
1838
+ function isContextualCssVarName(value): value is ContextualCssVarName;
1839
+ ```
1840
+
1841
+ Defined in: [tokens/contextual\_var.ts:70](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/contextual_var.ts#L70)
1842
+
1843
+ `true` when `value` is a [ContextualCssVarName](#contextualcssvarname-1).
1844
+
1845
+ #### Parameters
1846
+
1847
+ | Parameter | Type | Description |
1848
+ | ------ | ------ | ------ |
1849
+ | `value` | `unknown` | Value to test. |
1850
+
1851
+ #### Returns
1852
+
1853
+ `value is ContextualCssVarName`
1854
+
1855
+ ***
1856
+
1857
+ ### isCssToken() [#iscsstoken]
1858
+
1859
+ ```ts
1860
+ function isCssToken(value): value is CssToken;
1861
+ ```
1862
+
1863
+ Defined in: [tokens/theme\_token.ts:41](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/theme_token.ts#L41)
1864
+
1865
+ `true` when `value` is a [CssToken](#csstoken).
1866
+
1867
+ #### Parameters
1868
+
1869
+ | Parameter | Type | Description |
1870
+ | ------ | ------ | ------ |
1871
+ | `value` | `unknown` | Value to test. |
1872
+
1873
+ #### Returns
1874
+
1875
+ `value is CssToken`
1876
+
1877
+ ***
1878
+
1879
+ ### isScaleToken() [#isscaletoken]
1880
+
1881
+ ```ts
1882
+ function isScaleToken(value): value is ScaleToken;
1883
+ ```
1884
+
1885
+ Defined in: [tokens/scale\_token.ts:40](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/scale_token.ts#L40)
1886
+
1887
+ `true` when `value` is a [ScaleToken](#scaletoken).
1888
+
1889
+ #### Parameters
1890
+
1891
+ | Parameter | Type | Description |
1892
+ | ------ | ------ | ------ |
1893
+ | `value` | `unknown` | Value to test. |
1894
+
1895
+ #### Returns
1896
+
1897
+ `value is ScaleToken`
1898
+
1899
+ ***
1900
+
1901
+ ### lightDark() [#lightdark]
1902
+
1903
+ ```ts
1904
+ function lightDark(light, dark): SchemePair;
1905
+ ```
1906
+
1907
+ Defined in: [tokens/light\_dark.ts:31](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/light_dark.ts#L31)
1908
+
1909
+ Scheme-varying color pair. Both sides must be CSS `<color>` values.
1910
+
1911
+ #### Parameters
1912
+
1913
+ | Parameter | Type | Description |
1914
+ | ------ | ------ | ------ |
1915
+ | `light` | `string` | Light color-scheme value. |
1916
+ | `dark` | `string` | Dark color-scheme value. |
1917
+
1918
+ #### Returns
1919
+
1920
+ [`SchemePair`](#schemepair)
1921
+
1922
+ #### Throws
1923
+
1924
+ If either value is not a CSS `<color>`.
1925
+
1926
+ ***
1927
+
1928
+ ### mapDomain() [#mapdomain]
1929
+
1930
+ ```ts
1931
+ function mapDomain<TKey, TValue>(domain, factory): Record<TKey, TValue>;
1932
+ ```
1933
+
1934
+ Defined in: [styles/authoring.ts:171](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/authoring.ts#L171)
1935
+
1936
+ Builds a record keyed by `domain`. No CSS-collection side effect.
1937
+
1938
+ #### Type Parameters
1939
+
1940
+ | Type Parameter |
1941
+ | ------ |
1942
+ | `TKey` *extends* `string` |
1943
+ | `TValue` |
1944
+
1945
+ #### Parameters
1946
+
1947
+ | Parameter | Type | Description |
1948
+ | ------ | ------ | ------ |
1949
+ | `domain` | readonly `TKey`[] | All valid keys (e.g. `['primary', 'secondary']`). |
1950
+ | `factory` | (`value`) => `TValue` | Called once per key. |
1951
+
1952
+ #### Returns
1953
+
1954
+ `Record`\<`TKey`, `TValue`\>
1955
+
1956
+ ***
1957
+
1958
+ ### media() [#media-2]
1959
+
1960
+ ```ts
1961
+ function media(query, rules): StyleMedia;
1962
+ ```
1963
+
1964
+ Defined in: [styles/authoring.ts:121](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/authoring.ts#L121)
1965
+
1966
+ `@media` block wrapping rules.
1967
+
1968
+ #### Parameters
1969
+
1970
+ | Parameter | Type | Description |
1971
+ | ------ | ------ | ------ |
1972
+ | `query` | `string` | Media query string (e.g. `(min-width: 600px)`). |
1973
+ | `rules` | readonly [`StyleRule`](#stylerule)[] | Inner rules scoped to this block. |
1974
+
1975
+ #### Returns
1976
+
1977
+ [`StyleMedia`](#stylemedia)
1978
+
1979
+ ***
1980
+
1981
+ ### renderStyles() [#renderstyles-1]
1982
+
1983
+ ```ts
1984
+ function renderStyles(
1985
+ environment,
1986
+ collector,
1987
+ resolver?,
1988
+ options?
1989
+ ): string;
1990
+ ```
1991
+
1992
+ Defined in: [runtime.ts:39](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/runtime.ts#L39)
1993
+
1994
+ Emits collected CSS: theme block, then entries, minified.
1995
+
1996
+ #### Parameters
1997
+
1998
+ | Parameter | Type | Description |
1999
+ | ------ | ------ | ------ |
2000
+ | `environment` | [`DistilleryEnvironment`](#distilleryenvironment-1)\<`unknown`\> | Theme vars, prefix, and scope for this render. |
2001
+ | `collector` | [`StylesCollector`](#stylescollector) | Reachable entries and deps. |
2002
+ | `resolver` | [`StyleNameResolver`](#stylenameresolver) | Defaults to `collector.createResolver()`. |
2003
+ | `options` | [`RenderStylesOptions`](#renderstylesoptions) | - |
2004
+
2005
+ #### Returns
2006
+
2007
+ `string`
2008
+
2009
+ ***
2010
+
2011
+ ### resolveThemeValues() [#resolvethemevalues]
2012
+
2013
+ ```ts
2014
+ function resolveThemeValues<T>(
2015
+ theme,
2016
+ themeVars,
2017
+ scheme,
2018
+ variation?
2019
+ ): ValuesOf<T>;
2020
+ ```
2021
+
2022
+ Defined in: [theme.ts:142](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L142)
2023
+
2024
+ Nested literal values for one scheme. Walks `theme` so [ScaleToken](#scaletoken) leaves resolve to `.value`.
2025
+
2026
+ #### Type Parameters
2027
+
2028
+ | Type Parameter |
2029
+ | ------ |
2030
+ | `T` *extends* [`ThemeTree`](#themetree) |
2031
+
2032
+ #### Parameters
2033
+
2034
+ | Parameter | Type | Description |
2035
+ | ------ | ------ | ------ |
2036
+ | `theme` | `T` | Authoring tree that produced `themeVars`. |
2037
+ | `themeVars` | `Readonly`\<`Record`\<`string`, [`ThemeVarDefinition`](#themevardefinition)\>\> | Base registry from [Distillery.themeVars](#themevars). |
2038
+ | `scheme` | `"light"` \| `"dark"` | Which side of each [ThemeVarDefinition](#themevardefinition) to read. |
2039
+ | `variation?` | [`ResolvedThemeVariation`](#resolvedthemevariation) | When set, overridden paths come from `variation.diffs`; everything else stays on `themeVars`. |
2040
+
2041
+ #### Returns
2042
+
2043
+ [`ValuesOf`](#valuesof)\<`T`\>
2044
+
2045
+ ***
2046
+
2047
+ ### rule() [#rule]
2048
+
2049
+ ```ts
2050
+ function rule(
2051
+ selector,
2052
+ declarations,
2053
+ options?
2054
+ ): StyleRule;
2055
+ ```
2056
+
2057
+ Defined in: [styles/authoring.ts:97](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/authoring.ts#L97)
2058
+
2059
+ Selector plus declarations. `dependsOn` is filled when the module is constructed.
2060
+
2061
+ #### Parameters
2062
+
2063
+ | Parameter | Type | Description |
2064
+ | ------ | ------ | ------ |
2065
+ | `selector` | (`h`) => `string` | Factory receiving a [StyleSelectorResolver](#styleselectorresolver); uses `&` and handle aliases. |
2066
+ | `declarations` | [`Declarations`](#declarations) | CSS properties for this rule. |
2067
+ | `options` | [`RuleOptions`](#ruleoptions) | `auto` controls whether the rule self-collects when its handle dependencies are met. |
2068
+
2069
+ #### Returns
2070
+
2071
+ [`StyleRule`](#stylerule)
2072
+
2073
+ ***
2074
+
2075
+ ### scaleToken() [#scaletoken-1]
2076
+
2077
+ ```ts
2078
+ function scaleToken(value, cq): ScaleToken;
2079
+ ```
2080
+
2081
+ Defined in: [tokens/scale\_token.ts:25](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/scale_token.ts#L25)
2082
+
2083
+ Literal size token. Stringifies to `value`; `cq` is the container-relative variant.
2084
+
2085
+ #### Parameters
2086
+
2087
+ | Parameter | Type |
2088
+ | ------ | ------ |
2089
+ | `value` | `string` |
2090
+ | `cq` | `string` |
2091
+
2092
+ #### Returns
2093
+
2094
+ [`ScaleToken`](#scaletoken)
2095
+
2096
+ ***
2097
+
2098
+ ### themeToken() [#themetoken]
2099
+
2100
+ ```ts
2101
+ function themeToken(path, cssVar): CssToken;
2102
+ ```
2103
+
2104
+ Defined in: [tokens/theme\_token.ts:27](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/tokens/theme_token.ts#L27)
2105
+
2106
+ Theme token that stringifies to `var(<cssVar>)`.
2107
+
2108
+ #### Parameters
2109
+
2110
+ | Parameter | Type |
2111
+ | ------ | ------ |
2112
+ | `path` | `string` |
2113
+ | `cssVar` | `` `--${string}` `` |
2114
+
2115
+ #### Returns
2116
+
2117
+ [`CssToken`](#csstoken)
2118
+
2119
+ ***
2120
+
2121
+ ### variants() [#variants]
2122
+
2123
+ ```ts
2124
+ function variants<TKey, TValue>(domain, factory): Record<TKey, TValue>;
2125
+ ```
2126
+
2127
+ Defined in: [styles/authoring.ts:186](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/styles/authoring.ts#L186)
2128
+
2129
+ Builds a record of styles keyed by `domain`. Each value is marked `variant` so [StylesCollector.use](#use) skips it.
2130
+
2131
+ #### Type Parameters
2132
+
2133
+ | Type Parameter |
2134
+ | ------ |
2135
+ | `TKey` *extends* `string` |
2136
+ | `TValue` |
2137
+
2138
+ #### Parameters
2139
+
2140
+ | Parameter | Type | Description |
2141
+ | ------ | ------ | ------ |
2142
+ | `domain` | readonly `TKey`[] | All valid variant keys (e.g. `['primary', 'secondary']`). |
2143
+ | `factory` | (`value`) => `TValue` | Called once per key; returns the handle or nested style object for that variant. |
2144
+
2145
+ #### Returns
2146
+
2147
+ `Record`\<`TKey`, `TValue`\>
2148
+
2149
+ ***
2150
+
2151
+ ### zipSchemes() [#zipschemes]
2152
+
2153
+ ```ts
2154
+ function zipSchemes<T>(light, dark): Zipped<T>;
2155
+ ```
2156
+
2157
+ Defined in: [theme.ts:119](https://github.com/elastic/distillate/blob/f131912edadeb90a659ad22ee215412bedb1394d/src/theme.ts#L119)
2158
+
2159
+ 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
+
2161
+ #### Type Parameters
2162
+
2163
+ | Type Parameter |
2164
+ | ------ |
2165
+ | `T` *extends* [`SchemeValueTree`](#schemevaluetree) |
2166
+
2167
+ #### Parameters
2168
+
2169
+ | Parameter | Type | Description |
2170
+ | ------ | ------ | ------ |
2171
+ | `light` | `T` | Light-scheme value tree. |
2172
+ | `dark` | `T` | Dark-scheme value tree. |
2173
+
2174
+ #### Returns
2175
+
2176
+ [`Zipped`](#zipped)\<`T`\>
2177
+
2178
+ #### Throws
2179
+
2180
+ If shapes, leaf kinds, or scale values disagree, or if a differing string pair is not a CSS `<color>`.