@elastic/distillate 0.0.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) 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 +491 -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 +95 -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 +44 -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/sink.js +9 -0
  37. package/dist/cjs/sink.js.map +1 -0
  38. package/dist/cjs/styles/authoring.js +169 -0
  39. package/dist/cjs/styles/authoring.js.map +1 -0
  40. package/dist/cjs/styles/declarations.js +139 -0
  41. package/dist/cjs/styles/declarations.js.map +1 -0
  42. package/dist/cjs/styles/index.js +32 -0
  43. package/dist/cjs/styles/index.js.map +1 -0
  44. package/dist/cjs/styles/module.js +233 -0
  45. package/dist/cjs/styles/module.js.map +1 -0
  46. package/dist/cjs/styles/registry.js +187 -0
  47. package/dist/cjs/styles/registry.js.map +1 -0
  48. package/dist/cjs/styles/types.js +9 -0
  49. package/dist/cjs/styles/types.js.map +1 -0
  50. package/dist/cjs/testing.js +37 -0
  51. package/dist/cjs/testing.js.map +1 -0
  52. package/dist/cjs/theme.js +249 -0
  53. package/dist/cjs/theme.js.map +1 -0
  54. package/dist/cjs/tokens/contextual_var.js +39 -0
  55. package/dist/cjs/tokens/contextual_var.js.map +1 -0
  56. package/dist/cjs/tokens/index.js +24 -0
  57. package/dist/cjs/tokens/index.js.map +1 -0
  58. package/dist/cjs/tokens/kind.js +14 -0
  59. package/dist/cjs/tokens/kind.js.map +1 -0
  60. package/dist/cjs/tokens/light_dark.js +42 -0
  61. package/dist/cjs/tokens/light_dark.js.map +1 -0
  62. package/dist/cjs/tokens/scale_token.js +28 -0
  63. package/dist/cjs/tokens/scale_token.js.map +1 -0
  64. package/dist/cjs/tokens/theme_token.js +28 -0
  65. package/dist/cjs/tokens/theme_token.js.map +1 -0
  66. package/dist/cjs/var_invariant.js +115 -0
  67. package/dist/cjs/var_invariant.js.map +1 -0
  68. package/dist/collector.d.ts +101 -0
  69. package/dist/collector.d.ts.map +1 -0
  70. package/dist/collector.js +487 -0
  71. package/dist/collector.js.map +1 -0
  72. package/dist/css_scan.d.ts +57 -0
  73. package/dist/css_scan.d.ts.map +1 -0
  74. package/dist/css_scan.js +180 -0
  75. package/dist/css_scan.js.map +1 -0
  76. package/dist/dom_sink.d.ts +23 -0
  77. package/dist/dom_sink.d.ts.map +1 -0
  78. package/dist/dom_sink.js +36 -0
  79. package/dist/dom_sink.js.map +1 -0
  80. package/dist/emotion.d.ts +44 -0
  81. package/dist/emotion.d.ts.map +1 -0
  82. package/dist/emotion.js +184 -0
  83. package/dist/emotion.js.map +1 -0
  84. package/dist/engine.d.ts +66 -0
  85. package/dist/engine.d.ts.map +1 -0
  86. package/dist/engine.js +91 -0
  87. package/dist/engine.js.map +1 -0
  88. package/dist/environment.d.ts +43 -0
  89. package/dist/environment.d.ts.map +1 -0
  90. package/dist/environment.js +8 -0
  91. package/dist/environment.js.map +1 -0
  92. package/dist/hash.d.ts +2 -0
  93. package/dist/hash.d.ts.map +1 -0
  94. package/dist/hash.js +82 -0
  95. package/dist/hash.js.map +1 -0
  96. package/dist/idents.d.ts +9 -0
  97. package/dist/idents.d.ts.map +1 -0
  98. package/dist/idents.js +19 -0
  99. package/dist/idents.js.map +1 -0
  100. package/dist/index.d.ts +11 -0
  101. package/dist/index.d.ts.map +1 -0
  102. package/dist/index.js +15 -0
  103. package/dist/index.js.map +1 -0
  104. package/dist/instance.d.ts +16 -0
  105. package/dist/instance.d.ts.map +1 -0
  106. package/dist/instance.js +30 -0
  107. package/dist/instance.js.map +1 -0
  108. package/dist/local_vars.d.ts +75 -0
  109. package/dist/local_vars.d.ts.map +1 -0
  110. package/dist/local_vars.js +92 -0
  111. package/dist/local_vars.js.map +1 -0
  112. package/dist/minify.d.ts +11 -0
  113. package/dist/minify.d.ts.map +1 -0
  114. package/dist/minify.js +73 -0
  115. package/dist/minify.js.map +1 -0
  116. package/dist/names.d.ts +39 -0
  117. package/dist/names.d.ts.map +1 -0
  118. package/dist/names.js +70 -0
  119. package/dist/names.js.map +1 -0
  120. package/dist/nesting.d.ts +59 -0
  121. package/dist/nesting.d.ts.map +1 -0
  122. package/dist/nesting.js +400 -0
  123. package/dist/nesting.js.map +1 -0
  124. package/dist/runtime.d.ts +36 -0
  125. package/dist/runtime.d.ts.map +1 -0
  126. package/dist/runtime.js +252 -0
  127. package/dist/runtime.js.map +1 -0
  128. package/dist/sink.d.ts +16 -0
  129. package/dist/sink.d.ts.map +1 -0
  130. package/dist/sink.js +8 -0
  131. package/dist/sink.js.map +1 -0
  132. package/dist/styles/authoring.d.ts +59 -0
  133. package/dist/styles/authoring.d.ts.map +1 -0
  134. package/dist/styles/authoring.js +155 -0
  135. package/dist/styles/authoring.js.map +1 -0
  136. package/dist/styles/declarations.d.ts +10 -0
  137. package/dist/styles/declarations.d.ts.map +1 -0
  138. package/dist/styles/declarations.js +132 -0
  139. package/dist/styles/declarations.js.map +1 -0
  140. package/dist/styles/index.d.ts +7 -0
  141. package/dist/styles/index.d.ts.map +1 -0
  142. package/dist/styles/index.js +12 -0
  143. package/dist/styles/index.js.map +1 -0
  144. package/dist/styles/module.d.ts +5 -0
  145. package/dist/styles/module.d.ts.map +1 -0
  146. package/dist/styles/module.js +229 -0
  147. package/dist/styles/module.js.map +1 -0
  148. package/dist/styles/registry.d.ts +48 -0
  149. package/dist/styles/registry.d.ts.map +1 -0
  150. package/dist/styles/registry.js +182 -0
  151. package/dist/styles/registry.js.map +1 -0
  152. package/dist/styles/types.d.ts +211 -0
  153. package/dist/styles/types.d.ts.map +1 -0
  154. package/dist/styles/types.js +8 -0
  155. package/dist/styles/types.js.map +1 -0
  156. package/dist/testing.d.ts +10 -0
  157. package/dist/testing.d.ts.map +1 -0
  158. package/dist/testing.js +31 -0
  159. package/dist/testing.js.map +1 -0
  160. package/dist/theme.d.ts +85 -0
  161. package/dist/theme.d.ts.map +1 -0
  162. package/dist/theme.js +240 -0
  163. package/dist/theme.js.map +1 -0
  164. package/dist/tokens/contextual_var.d.ts +35 -0
  165. package/dist/tokens/contextual_var.d.ts.map +1 -0
  166. package/dist/tokens/contextual_var.js +33 -0
  167. package/dist/tokens/contextual_var.js.map +1 -0
  168. package/dist/tokens/index.d.ts +5 -0
  169. package/dist/tokens/index.d.ts.map +1 -0
  170. package/dist/tokens/index.js +11 -0
  171. package/dist/tokens/index.js.map +1 -0
  172. package/dist/tokens/kind.d.ts +2 -0
  173. package/dist/tokens/kind.d.ts.map +1 -0
  174. package/dist/tokens/kind.js +10 -0
  175. package/dist/tokens/kind.js.map +1 -0
  176. package/dist/tokens/light_dark.d.ts +20 -0
  177. package/dist/tokens/light_dark.d.ts.map +1 -0
  178. package/dist/tokens/light_dark.js +37 -0
  179. package/dist/tokens/light_dark.js.map +1 -0
  180. package/dist/tokens/scale_token.d.ts +20 -0
  181. package/dist/tokens/scale_token.d.ts.map +1 -0
  182. package/dist/tokens/scale_token.js +23 -0
  183. package/dist/tokens/scale_token.js.map +1 -0
  184. package/dist/tokens/theme_token.d.ts +20 -0
  185. package/dist/tokens/theme_token.d.ts.map +1 -0
  186. package/dist/tokens/theme_token.js +23 -0
  187. package/dist/tokens/theme_token.js.map +1 -0
  188. package/dist/var_invariant.d.ts +25 -0
  189. package/dist/var_invariant.d.ts.map +1 -0
  190. package/dist/var_invariant.js +108 -0
  191. package/dist/var_invariant.js.map +1 -0
  192. package/docs/concepts/authoring.md +115 -0
  193. package/docs/concepts/collection.md +66 -0
  194. package/docs/concepts/distillery.md +47 -0
  195. package/docs/concepts/index.md +18 -0
  196. package/docs/concepts/naming-and-output.md +123 -0
  197. package/docs/concepts/ordering.md +61 -0
  198. package/docs/concepts/single-copy.md +103 -0
  199. package/docs/concepts/tokens.md +99 -0
  200. package/docs/docset.yml +53 -0
  201. package/docs/examples/01-stylesheet.ts +20 -0
  202. package/docs/examples/02-artifact.ts +26 -0
  203. package/docs/examples/03-variants.ts +40 -0
  204. package/docs/examples/04-emotion.ts +33 -0
  205. package/docs/examples/05-var-invariant.ts +31 -0
  206. package/docs/examples/06-payload.ts +85 -0
  207. package/docs/examples/fixture.ts +22 -0
  208. package/docs/getting-started/index.md +14 -0
  209. package/docs/getting-started/installation.md +30 -0
  210. package/docs/getting-started/quick-start.md +61 -0
  211. package/docs/getting-started/your-first-stylesheet.md +57 -0
  212. package/docs/guides/compact-artifacts.md +87 -0
  213. package/docs/guides/emotion-migration.md +60 -0
  214. package/docs/guides/index.md +17 -0
  215. package/docs/guides/name-collisions.md +37 -0
  216. package/docs/guides/non-css-surfaces.md +73 -0
  217. package/docs/guides/react-renderer.md +202 -0
  218. package/docs/guides/theming.md +107 -0
  219. package/docs/guides/var-invariant.md +24 -0
  220. package/docs/guides/vs-emotion.md +61 -0
  221. package/docs/index.md +73 -0
  222. package/docs/logo.svg +7 -0
  223. package/docs/playground/index.html +12 -0
  224. package/docs/playground/package.json +23 -0
  225. package/docs/playground/src/app/app.tsx +109 -0
  226. package/docs/playground/src/app/css_panel.tsx +119 -0
  227. package/docs/playground/src/app/editor_panel.tsx +87 -0
  228. package/docs/playground/src/app/index.ts +8 -0
  229. package/docs/playground/src/app/monaco_css_editor.tsx +84 -0
  230. package/docs/playground/src/app/monaco_source_editor.tsx +132 -0
  231. package/docs/playground/src/app/preview_panel.tsx +99 -0
  232. package/docs/playground/src/app/tokens_panel.tsx +117 -0
  233. package/docs/playground/src/app/types.ts +10 -0
  234. package/docs/playground/src/examples/snippets.test.ts +28 -0
  235. package/docs/playground/src/examples/snippets.ts +418 -0
  236. package/docs/playground/src/lib/compile.test.ts +157 -0
  237. package/docs/playground/src/lib/compile.ts +242 -0
  238. package/docs/playground/src/lib/demo_environment.test.ts +123 -0
  239. package/docs/playground/src/lib/demo_environment.ts +140 -0
  240. package/docs/playground/src/lib/editor_lib.test.ts +39 -0
  241. package/docs/playground/src/lib/editor_lib.ts +142 -0
  242. package/docs/playground/src/lib/format_css.test.ts +41 -0
  243. package/docs/playground/src/lib/format_css.ts +71 -0
  244. package/docs/playground/src/main.tsx +25 -0
  245. package/docs/playground/src/setup/chrome.test.ts +47 -0
  246. package/docs/playground/src/setup/chrome.ts +365 -0
  247. package/docs/playground/src/setup/monaco_env.ts +64 -0
  248. package/docs/playground/tsconfig.json +22 -0
  249. package/docs/playground/vite.config.ts +37 -0
  250. package/docs/playground/vitest.config.ts +35 -0
  251. package/docs/playground.md +28 -0
  252. package/docs/reference/api/emotion.md +290 -0
  253. package/docs/reference/api/index-1.md +2387 -0
  254. package/docs/reference/api/index.md +9 -0
  255. package/docs/reference/api/testing.md +92 -0
  256. package/docs/reference/api.md +12 -0
  257. package/docs/reference/entry-points.md +139 -0
  258. package/docs/reference/environment.md +60 -0
  259. package/docs/reference/index.md +11 -0
  260. package/docs/reference/okf-map.md +93 -0
  261. package/package.json +127 -4
  262. package/src/collector.ts +612 -0
  263. package/src/css_scan.ts +263 -0
  264. package/src/dom_sink.ts +64 -0
  265. package/src/emotion.ts +308 -0
  266. package/src/engine.ts +241 -0
  267. package/src/environment.ts +56 -0
  268. package/src/hash.ts +111 -0
  269. package/src/idents.ts +21 -0
  270. package/src/index.ts +106 -0
  271. package/src/instance.ts +49 -0
  272. package/src/local_vars.ts +220 -0
  273. package/src/minify.ts +87 -0
  274. package/src/names.ts +129 -0
  275. package/src/nesting.ts +596 -0
  276. package/src/runtime.ts +428 -0
  277. package/src/sink.ts +25 -0
  278. package/src/styles/authoring.ts +244 -0
  279. package/src/styles/declarations.ts +172 -0
  280. package/src/styles/index.ts +58 -0
  281. package/src/styles/module.ts +396 -0
  282. package/src/styles/registry.ts +261 -0
  283. package/src/styles/types.ts +283 -0
  284. package/src/testing.ts +48 -0
  285. package/src/theme.ts +454 -0
  286. package/src/tokens/contextual_var.ts +72 -0
  287. package/src/tokens/index.ts +17 -0
  288. package/src/tokens/kind.ts +13 -0
  289. package/src/tokens/light_dark.ts +58 -0
  290. package/src/tokens/scale_token.ts +41 -0
  291. package/src/tokens/theme_token.ts +42 -0
  292. package/src/var_invariant.ts +147 -0
@@ -0,0 +1,28 @@
1
+ ---
2
+ navigation_title: Playground
3
+ description: Live Distillate editor with stylesheet, compact names, and a tree-shaken artifact.
4
+ ---
5
+
6
+ # Playground
7
+
8
+ The playground is a full-viewport workbench: source and tokens on the left, a centered live preview in the remaining canvas, and generated CSS under the preview.
9
+
10
+ - **On GitHub Pages:** [elastic.github.io/distillate/playground](https://elastic.github.io/distillate/playground/)
11
+ - **Locally:** `pnpm playground:dev` from the repo root (Vite, default <http://localhost:5173>)
12
+
13
+ Two authoring modes share one demo environment (`prefix: 'dstl'`, theme vars on `:host`):
14
+
15
+ - **Emotion** — tagged `css` templates, plus `cx`, `injectGlobal`, `tokens`, and `cn`
16
+ - **Native module** — `createStyleModule`, `rule`, `media`, `container`, `variants`, `tokens`, `cn`
17
+
18
+ The editor is Monaco with TypeScript IntelliSense for the injected playground scope (`css` / `createStyleModule`, `tokens`, `cn`, …). Generated CSS is a read-only Monaco view of the compile output. Imports in snippets are educational; the real bindings are injected at eval time. Each snippet ends in `return` of an HTML string.
19
+
20
+ **Readable** and **Compact** are naming modes on the full stylesheet (`stylesheetCollector`). **Artifact** is the compact payload from the handles the returned markup actually named (`artifactCollector`, after collection completes). Byte counts for the full stylesheet versus that artifact stay visible above the CSS; they are the same comparison as [`docs/examples/06-payload.ts`](https://github.com/elastic/distillate/blob/main/docs/examples/06-payload.ts). Card, Buttons, Tree shake, Local vars, and Media + container ship in both modes so you can compare authoring. Switching Emotion vs Native keeps the selected example. **Tree shake** names one style in the markup; the stylesheet still contains the rest. See [`docs/playground/src/examples/snippets.ts`](https://github.com/elastic/distillate/blob/main/docs/playground/src/examples/snippets.ts).
21
+
22
+ Emotion handles collect when `cx(...)`, `cn(...)`, or string interpolation (`${handle}`) runs during the returned markup. `injectGlobal` still follows engine semantics: it ships in the stylesheet and is omitted from the artifact unless you collect those modules yourself.
23
+
24
+ A read-only Tokens table sits under the editor and lists every `tokens.*` path in the demo environment with its resolved CSS (`themeVars` light/dark for colors and fonts; `value` / `.cq` for scales). Color swatches follow the Preview Light/Dark toggle. Demo colors use Borealis brand values (`primary`, `accent`, `accentSecondary`, `success`, `warning`, `danger`) plus text, surface, subtle, and border — hard-coded, not imported from EUI.
25
+
26
+ The chrome around the editor is itself a Distillate readable stylesheet (`prefix: 'pg'`, theme vars on `:root`), kept on a separate distillery from snippet compilation so the two registries never mix.
27
+
28
+ The compile pipeline is sucrase (TypeScript → JS) then `new Function`. It is a demo, not a sandbox: do not paste untrusted source.
@@ -0,0 +1,290 @@
1
+ # emotion
2
+
3
+ ## Interfaces
4
+
5
+ ### CreateEmotionOptions [#createemotionoptions]
6
+
7
+ Defined in: [emotion.ts:30](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/emotion.ts#L30)
8
+
9
+ Shared sink for Emotion compat modules on one registry.
10
+
11
+ #### Properties
12
+
13
+ | Property | Type | Description | Defined in |
14
+ | ------ | ------ | ------ | ------ |
15
+ | $$$sink$$$ `sink?` | [`StyleSink`](index-1.md#stylesink) | Notified when a compat module registers. Shared across `createEmotion` calls on the same registry. | [emotion.ts:32](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/emotion.ts#L32) |
16
+
17
+ ***
18
+
19
+ ### Emotion [#emotion]
20
+
21
+ Defined in: [emotion.ts:56](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/emotion.ts#L56)
22
+
23
+ Emotion-shaped authoring API bound to one Distillery registry.
24
+
25
+ #### Methods
26
+
27
+ ##### css() [#css]
28
+
29
+ ```ts
30
+ css(strings, ...values): EmotionCss;
31
+ ```
32
+
33
+ Defined in: [emotion.ts:58](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/emotion.ts#L58)
34
+
35
+ Authors styles and returns a handle that can be used directly or passed to `cx`.
36
+
37
+ ###### Parameters
38
+
39
+ | Parameter | Type |
40
+ | ------ | ------ |
41
+ | `strings` | `TemplateStringsArray` |
42
+ | ...`values` | readonly `unknown`[] |
43
+
44
+ ###### Returns
45
+
46
+ [`EmotionCss`](#emotioncss-1)
47
+
48
+ ##### cx() [#cx]
49
+
50
+ ```ts
51
+ cx(...args): string;
52
+ ```
53
+
54
+ Defined in: [emotion.ts:60](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/emotion.ts#L60)
55
+
56
+ Combines handles, conditional classes, and plain strings into a space-separated string.
57
+
58
+ ###### Parameters
59
+
60
+ | Parameter | Type |
61
+ | ------ | ------ |
62
+ | ...`args` | readonly [`ClassNameArg`](#classnamearg)[] |
63
+
64
+ ###### Returns
65
+
66
+ `string`
67
+
68
+ ##### globalModules() [#globalmodules]
69
+
70
+ ```ts
71
+ globalModules(): readonly StylesModule<StylesObject>[];
72
+ ```
73
+
74
+ Defined in: [emotion.ts:69](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/emotion.ts#L69)
75
+
76
+ Returns the underlying modules backing `injectGlobal` calls.
77
+
78
+ ###### Returns
79
+
80
+ readonly [`StylesModule`](index-1.md#stylesmodule)\<[`StylesObject`](index-1.md#stylesobject)\>[]
81
+
82
+ ##### injectGlobal() [#injectglobal]
83
+
84
+ ```ts
85
+ injectGlobal(strings, ...values): void;
86
+ ```
87
+
88
+ Defined in: [emotion.ts:62](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/emotion.ts#L62)
89
+
90
+ Defines styles that apply globally (e.g. `body`, `html`).
91
+
92
+ ###### Parameters
93
+
94
+ | Parameter | Type |
95
+ | ------ | ------ |
96
+ | `strings` | `TemplateStringsArray` |
97
+ | ...`values` | readonly `unknown`[] |
98
+
99
+ ###### Returns
100
+
101
+ `void`
102
+
103
+ ##### stylesheet() [#stylesheet]
104
+
105
+ ```ts
106
+ stylesheet(): string;
107
+ ```
108
+
109
+ Defined in: [emotion.ts:67](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/emotion.ts#L67)
110
+
111
+ Emits the full CSS for all generated emotion styles.
112
+
113
+ ###### Returns
114
+
115
+ `string`
116
+
117
+ ***
118
+
119
+ ### EmotionCss [#emotioncss-1]
120
+
121
+ Defined in: [emotion.ts:36](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/emotion.ts#L36)
122
+
123
+ Style handle that stringifies to its readable class name.
124
+
125
+ #### Extends
126
+
127
+ - [`StyleHandle`](index-1.md#stylehandle)
128
+
129
+ #### Properties
130
+
131
+ | Property | Modifier | Type | Description | Inherited from | Defined in |
132
+ | ------ | ------ | ------ | ------ | ------ | ------ |
133
+ | $$$declarations$$$ `declarations` | `readonly` | [`Declarations`](index-1.md#declarations) | CSS properties for this handle. | [`StyleHandle`](index-1.md#stylehandle).[`declarations`](index-1.md#declarations-1) | [styles/types.ts:117](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L117) |
134
+ | $$$key$$$ `key` | `readonly` | `string` | Full path joined by dots. | [`StyleHandle`](index-1.md#stylehandle).[`key`](index-1.md#key-1) | [styles/types.ts:113](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L113) |
135
+ | $$$kind$$$ `kind` | `readonly` | `"handle"` | Discriminant for [StyleEntry](index-1.md#styleentry). | [`StyleHandle`](index-1.md#stylehandle).[`kind`](index-1.md#kind) | [styles/types.ts:107](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L107) |
136
+ | $$$localname$$$ `localName` | `readonly` | `string` | Leaf key if at root, or composed path for nested handles. | [`StyleHandle`](index-1.md#stylehandle).[`localName`](index-1.md#localname) | [styles/types.ts:111](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L111) |
137
+ | $$$modulename$$$ `moduleName` | `readonly` | `string` | The registered module name this handle belongs to. | [`StyleHandle`](index-1.md#stylehandle).[`moduleName`](index-1.md#modulename) | [styles/types.ts:109](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L109) |
138
+ | $$$readablename$$$ `readableName` | `readonly` | `string` | Predictable name used for output CSS classes. | [`StyleHandle`](index-1.md#stylehandle).[`readableName`](index-1.md#readablename) | [styles/types.ts:115](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L115) |
139
+ | $$$variant$$$ `variant` | `readonly` | `boolean` | `true` when produced inside `variants(...)`. Skipped by [StylesCollector.use](index-1.md#use). | [`StyleHandle`](index-1.md#stylehandle).[`variant`](index-1.md#variant) | [styles/types.ts:119](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L119) |
140
+
141
+ #### Methods
142
+
143
+ ##### \[toPrimitive\]() [#toprimitive]
144
+
145
+ ```ts
146
+ toPrimitive: string;
147
+ ```
148
+
149
+ Defined in: [emotion.ts:40](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/emotion.ts#L40)
150
+
151
+ Template interpolation; same as [EmotionCss.toString](#tostring).
152
+
153
+ ###### Parameters
154
+
155
+ | Parameter | Type |
156
+ | ------ | ------ |
157
+ | `hint` | `string` |
158
+
159
+ ###### Returns
160
+
161
+ `string`
162
+
163
+ ##### resolveClassName() [#resolveclassname]
164
+
165
+ ```ts
166
+ resolveClassName(context): string;
167
+ ```
168
+
169
+ Defined in: [styles/types.ts:121](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/styles/types.ts#L121)
170
+
171
+ Produces the final class name via the provided resolver context.
172
+
173
+ ###### Parameters
174
+
175
+ | Parameter | Type | Description |
176
+ | ------ | ------ | ------ |
177
+ | `context` | \{ `resolveClassName`: (...`handles`) => `string`; \} | - |
178
+ | `context.resolveClassName` | (...`handles`) => `string` | Joins one or more handles into a class-name string. |
179
+
180
+ ###### Returns
181
+
182
+ `string`
183
+
184
+ ###### Inherited from
185
+
186
+ [`StyleHandle`](index-1.md#stylehandle).[`resolveClassName`](index-1.md#resolveclassname-1)
187
+
188
+ ##### toString() [#tostring]
189
+
190
+ ```ts
191
+ toString(): string;
192
+ ```
193
+
194
+ Defined in: [emotion.ts:38](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/emotion.ts#L38)
195
+
196
+ Stringifies to the readable class name.
197
+
198
+ ###### Returns
199
+
200
+ `string`
201
+
202
+ ## Type Aliases
203
+
204
+ ### ClassNameArg [#classnamearg]
205
+
206
+ ```ts
207
+ type ClassNameArg =
208
+ | string
209
+ | number
210
+ | false
211
+ | null
212
+ | undefined
213
+ | EmotionCss
214
+ | StyleHandle
215
+ | ClassNameArg[]
216
+ | {
217
+ [className: string]: boolean;
218
+ };
219
+ ```
220
+
221
+ Defined in: [emotion.ts:44](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/emotion.ts#L44)
222
+
223
+ One `cx(...)` argument: a class, handle, list, or truthy map.
224
+
225
+ ## Functions
226
+
227
+ ### createEmotion() [#createemotion]
228
+
229
+ ```ts
230
+ function createEmotion<TTokens>(distillery, options?): Emotion;
231
+ ```
232
+
233
+ Defined in: [emotion.ts:114](https://github.com/elastic/distillate/blob/d1dccb0eb5372d5984331c21603220340752a304/src/emotion.ts#L114)
234
+
235
+ `@emotion/css`-shaped API over a distillery.
236
+
237
+ `String(css\`...\`)` is the readable class name and does not collect. Passing the wrapper through `resolveClassName` collects and compacts like a native handle.
238
+
239
+ #### Type Parameters
240
+
241
+ | Type Parameter |
242
+ | ------ |
243
+ | `TTokens` |
244
+
245
+ #### Parameters
246
+
247
+ | Parameter | Type | Description |
248
+ | ------ | ------ | ------ |
249
+ | `distillery` | [`Distillery`](index-1.md#distillery)\<`TTokens`\> | Bound distillery that owns the underlying registry. |
250
+ | `options` | [`CreateEmotionOptions`](#createemotionoptions) | Optional sink for DOM injection. |
251
+
252
+ #### Returns
253
+
254
+ [`Emotion`](#emotion)
255
+
256
+ ## References
257
+
258
+ ### createDomSink [#createdomsink]
259
+
260
+ Re-exports [createDomSink](index-1.md#createdomsink)
261
+
262
+ ***
263
+
264
+ ### CreateDomSinkOptions [#createdomsinkoptions]
265
+
266
+ Re-exports [CreateDomSinkOptions](index-1.md#createdomsinkoptions)
267
+
268
+ ***
269
+
270
+ ### DocumentLike [#documentlike]
271
+
272
+ Re-exports [DocumentLike](index-1.md#documentlike)
273
+
274
+ ***
275
+
276
+ ### StyleElementLike [#styleelementlike]
277
+
278
+ Re-exports [StyleElementLike](index-1.md#styleelementlike)
279
+
280
+ ***
281
+
282
+ ### StyleParentLike [#styleparentlike]
283
+
284
+ Re-exports [StyleParentLike](index-1.md#styleparentlike)
285
+
286
+ ***
287
+
288
+ ### StyleSink [#stylesink]
289
+
290
+ Re-exports [StyleSink](index-1.md#stylesink)