@tenphi/tasty 0.0.0-snapshot.bbd10c7 → 0.0.0-snapshot.bbd36bd

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 (368) hide show
  1. package/README.md +196 -140
  2. package/dist/astro-CeYENy2x.js +301 -0
  3. package/dist/astro-CeYENy2x.js.map +1 -0
  4. package/dist/{ssr/async-storage.js → async-storage-DKK-wTD4.js} +16 -6
  5. package/dist/async-storage-DKK-wTD4.js.map +1 -0
  6. package/dist/babel-DWCsafYw.d.ts +83 -0
  7. package/dist/collector-B3OsM252.js +327 -0
  8. package/dist/collector-B3OsM252.js.map +1 -0
  9. package/dist/collector-BTVXj2hS.d.ts +163 -0
  10. package/dist/config-B3gPdCqd.js +12421 -0
  11. package/dist/config-B3gPdCqd.js.map +1 -0
  12. package/dist/config-LfIDmVHx.d.ts +1363 -0
  13. package/dist/context-CA8YKeMn.js +24 -0
  14. package/dist/context-CA8YKeMn.js.map +1 -0
  15. package/dist/core/index.d.ts +5 -34
  16. package/dist/core/index.js +6 -27
  17. package/dist/core-DGm0CFHP.js +1732 -0
  18. package/dist/core-DGm0CFHP.js.map +1 -0
  19. package/dist/css-resources-Cyl_axbI.js +149 -0
  20. package/dist/css-resources-Cyl_axbI.js.map +1 -0
  21. package/dist/{zero/extractor.js → css-writer-Bgowobbx.js} +148 -24
  22. package/dist/css-writer-Bgowobbx.js.map +1 -0
  23. package/dist/{ssr/format-global-rules.js → format-global-rules-DklyaXv-.js} +2 -2
  24. package/dist/format-global-rules-DklyaXv-.js.map +1 -0
  25. package/dist/{ssr/format-rules.js → format-rules-XRw9u7d4.js} +33 -2
  26. package/dist/format-rules-XRw9u7d4.js.map +1 -0
  27. package/dist/hydrate-CNOmZprz.js +37 -0
  28. package/dist/hydrate-CNOmZprz.js.map +1 -0
  29. package/dist/index-Bm9ltvdH.d.ts +1933 -0
  30. package/dist/index-BmogEzTo.d.ts +1575 -0
  31. package/dist/index.d.ts +5 -51
  32. package/dist/index.js +922 -36
  33. package/dist/index.js.map +1 -0
  34. package/dist/keyframes-DE-OE76F.js +535 -0
  35. package/dist/keyframes-DE-OE76F.js.map +1 -0
  36. package/dist/{utils/merge-styles.d.ts → merge-styles-BcLl1u_d.d.ts} +3 -3
  37. package/dist/{utils/merge-styles.js → merge-styles-DuoZEsm9.js} +3 -4
  38. package/dist/merge-styles-DuoZEsm9.js.map +1 -0
  39. package/dist/{utils/resolve-recipes.js → resolve-recipes-H9NqOQuP.js} +4 -6
  40. package/dist/resolve-recipes-H9NqOQuP.js.map +1 -0
  41. package/dist/ssr/astro-client.js +19 -0
  42. package/dist/ssr/astro-client.js.map +1 -0
  43. package/dist/ssr/astro-middleware-extract-static.d.ts +11 -0
  44. package/dist/ssr/astro-middleware-extract-static.js +9 -0
  45. package/dist/ssr/astro-middleware-extract-static.js.map +1 -0
  46. package/dist/ssr/astro-middleware-extract.d.ts +11 -0
  47. package/dist/ssr/astro-middleware-extract.js +9 -0
  48. package/dist/ssr/astro-middleware-extract.js.map +1 -0
  49. package/dist/ssr/astro-middleware-static.d.ts +18 -0
  50. package/dist/ssr/astro-middleware-static.js +18 -0
  51. package/dist/ssr/astro-middleware-static.js.map +1 -0
  52. package/dist/ssr/astro-middleware.d.ts +19 -0
  53. package/dist/ssr/astro-middleware.js +19 -0
  54. package/dist/ssr/astro-middleware.js.map +1 -0
  55. package/dist/ssr/astro.d.ts +117 -11
  56. package/dist/ssr/astro.js +2 -64
  57. package/dist/ssr/index.d.ts +37 -4
  58. package/dist/ssr/index.js +6 -6
  59. package/dist/ssr/index.js.map +1 -1
  60. package/dist/ssr/next-config.d.ts +66 -0
  61. package/dist/ssr/next-config.js +115 -0
  62. package/dist/ssr/next-config.js.map +1 -0
  63. package/dist/ssr/next.d.ts +14 -5
  64. package/dist/ssr/next.js +32 -15
  65. package/dist/ssr/next.js.map +1 -1
  66. package/dist/ssr-collector-ref-COs_ioWl.js +29 -0
  67. package/dist/ssr-collector-ref-COs_ioWl.js.map +1 -0
  68. package/dist/static/index.d.ts +91 -5
  69. package/dist/static/index.js +49 -3
  70. package/dist/static/index.js.map +1 -0
  71. package/dist/static/inject.js.map +1 -1
  72. package/dist/zero/babel.d.ts +2 -182
  73. package/dist/zero/babel.js +80 -40
  74. package/dist/zero/babel.js.map +1 -1
  75. package/dist/zero/index.d.ts +81 -3
  76. package/dist/zero/index.js +2 -3
  77. package/dist/zero/next.d.ts +1 -1
  78. package/dist/zero/next.js +1 -1
  79. package/dist/zero/next.js.map +1 -1
  80. package/docs/README.md +20 -12
  81. package/docs/adoption.md +59 -32
  82. package/docs/ai-agents.md +224 -0
  83. package/docs/comparison.md +76 -48
  84. package/docs/configuration.md +566 -69
  85. package/docs/debug.md +35 -18
  86. package/docs/design-system.md +63 -32
  87. package/docs/dsl.md +527 -179
  88. package/docs/getting-started.md +62 -41
  89. package/docs/injector.md +157 -51
  90. package/docs/methodology.md +69 -37
  91. package/docs/migration-v3.md +285 -0
  92. package/docs/pipeline.md +741 -0
  93. package/docs/plugins.md +353 -0
  94. package/docs/{runtime.md → react-api.md} +176 -67
  95. package/docs/runtime-benchmarks.md +351 -0
  96. package/docs/ssr.md +350 -94
  97. package/docs/styles.md +65 -16
  98. package/docs/tasty-static.md +149 -87
  99. package/package.json +78 -23
  100. package/tasty.config.ts +6 -0
  101. package/dist/_virtual/_rolldown/runtime.js +0 -7
  102. package/dist/chunks/cacheKey.js +0 -77
  103. package/dist/chunks/cacheKey.js.map +0 -1
  104. package/dist/chunks/definitions.d.ts +0 -37
  105. package/dist/chunks/definitions.js +0 -258
  106. package/dist/chunks/definitions.js.map +0 -1
  107. package/dist/chunks/index.d.ts +0 -1
  108. package/dist/chunks/renderChunk.d.ts +0 -1
  109. package/dist/chunks/renderChunk.js +0 -59
  110. package/dist/chunks/renderChunk.js.map +0 -1
  111. package/dist/compute-styles.d.ts +0 -31
  112. package/dist/compute-styles.js +0 -356
  113. package/dist/compute-styles.js.map +0 -1
  114. package/dist/config.d.ts +0 -372
  115. package/dist/config.js +0 -507
  116. package/dist/config.js.map +0 -1
  117. package/dist/counter-style/index.js +0 -51
  118. package/dist/counter-style/index.js.map +0 -1
  119. package/dist/debug.d.ts +0 -89
  120. package/dist/debug.js +0 -453
  121. package/dist/debug.js.map +0 -1
  122. package/dist/font-face/index.js +0 -63
  123. package/dist/font-face/index.js.map +0 -1
  124. package/dist/hooks/index.d.ts +0 -7
  125. package/dist/hooks/useCounterStyle.d.ts +0 -50
  126. package/dist/hooks/useCounterStyle.js +0 -45
  127. package/dist/hooks/useCounterStyle.js.map +0 -1
  128. package/dist/hooks/useFontFace.d.ts +0 -43
  129. package/dist/hooks/useFontFace.js +0 -69
  130. package/dist/hooks/useFontFace.js.map +0 -1
  131. package/dist/hooks/useGlobalStyles.d.ts +0 -30
  132. package/dist/hooks/useGlobalStyles.js +0 -77
  133. package/dist/hooks/useGlobalStyles.js.map +0 -1
  134. package/dist/hooks/useKeyframes.d.ts +0 -56
  135. package/dist/hooks/useKeyframes.js +0 -63
  136. package/dist/hooks/useKeyframes.js.map +0 -1
  137. package/dist/hooks/useProperty.d.ts +0 -79
  138. package/dist/hooks/useProperty.js +0 -108
  139. package/dist/hooks/useProperty.js.map +0 -1
  140. package/dist/hooks/useRawCSS.d.ts +0 -53
  141. package/dist/hooks/useRawCSS.js +0 -34
  142. package/dist/hooks/useRawCSS.js.map +0 -1
  143. package/dist/hooks/useStyles.d.ts +0 -40
  144. package/dist/hooks/useStyles.js +0 -29
  145. package/dist/hooks/useStyles.js.map +0 -1
  146. package/dist/injector/index.d.ts +0 -166
  147. package/dist/injector/index.js +0 -166
  148. package/dist/injector/index.js.map +0 -1
  149. package/dist/injector/injector.d.ts +0 -166
  150. package/dist/injector/injector.js +0 -464
  151. package/dist/injector/injector.js.map +0 -1
  152. package/dist/injector/sheet-manager.d.ts +0 -136
  153. package/dist/injector/sheet-manager.js +0 -733
  154. package/dist/injector/sheet-manager.js.map +0 -1
  155. package/dist/injector/types.d.ts +0 -204
  156. package/dist/keyframes/index.js +0 -206
  157. package/dist/keyframes/index.js.map +0 -1
  158. package/dist/parser/classify.js +0 -319
  159. package/dist/parser/classify.js.map +0 -1
  160. package/dist/parser/const.js +0 -60
  161. package/dist/parser/const.js.map +0 -1
  162. package/dist/parser/lru.js +0 -109
  163. package/dist/parser/lru.js.map +0 -1
  164. package/dist/parser/parser.d.ts +0 -25
  165. package/dist/parser/parser.js +0 -115
  166. package/dist/parser/parser.js.map +0 -1
  167. package/dist/parser/tokenizer.js +0 -69
  168. package/dist/parser/tokenizer.js.map +0 -1
  169. package/dist/parser/types.d.ts +0 -51
  170. package/dist/parser/types.js +0 -46
  171. package/dist/parser/types.js.map +0 -1
  172. package/dist/pipeline/conditions.d.ts +0 -134
  173. package/dist/pipeline/conditions.js +0 -406
  174. package/dist/pipeline/conditions.js.map +0 -1
  175. package/dist/pipeline/exclusive.js +0 -230
  176. package/dist/pipeline/exclusive.js.map +0 -1
  177. package/dist/pipeline/index.d.ts +0 -55
  178. package/dist/pipeline/index.js +0 -708
  179. package/dist/pipeline/index.js.map +0 -1
  180. package/dist/pipeline/materialize.js +0 -1103
  181. package/dist/pipeline/materialize.js.map +0 -1
  182. package/dist/pipeline/parseStateKey.d.ts +0 -15
  183. package/dist/pipeline/parseStateKey.js +0 -446
  184. package/dist/pipeline/parseStateKey.js.map +0 -1
  185. package/dist/pipeline/simplify.js +0 -515
  186. package/dist/pipeline/simplify.js.map +0 -1
  187. package/dist/pipeline/warnings.js +0 -18
  188. package/dist/pipeline/warnings.js.map +0 -1
  189. package/dist/plugins/index.d.ts +0 -2
  190. package/dist/plugins/okhsl-plugin.d.ts +0 -35
  191. package/dist/plugins/okhsl-plugin.js +0 -97
  192. package/dist/plugins/okhsl-plugin.js.map +0 -1
  193. package/dist/plugins/types.d.ts +0 -76
  194. package/dist/properties/index.js +0 -222
  195. package/dist/properties/index.js.map +0 -1
  196. package/dist/properties/property-type-resolver.d.ts +0 -24
  197. package/dist/properties/property-type-resolver.js +0 -90
  198. package/dist/properties/property-type-resolver.js.map +0 -1
  199. package/dist/ssr/astro.js.map +0 -1
  200. package/dist/ssr/async-storage.d.ts +0 -17
  201. package/dist/ssr/async-storage.js.map +0 -1
  202. package/dist/ssr/collect-auto-properties.js +0 -39
  203. package/dist/ssr/collect-auto-properties.js.map +0 -1
  204. package/dist/ssr/collector.d.ts +0 -102
  205. package/dist/ssr/collector.js +0 -219
  206. package/dist/ssr/collector.js.map +0 -1
  207. package/dist/ssr/format-global-rules.js.map +0 -1
  208. package/dist/ssr/format-keyframes.js +0 -69
  209. package/dist/ssr/format-keyframes.js.map +0 -1
  210. package/dist/ssr/format-property.js +0 -49
  211. package/dist/ssr/format-property.js.map +0 -1
  212. package/dist/ssr/format-rules.js.map +0 -1
  213. package/dist/ssr/hydrate.d.ts +0 -22
  214. package/dist/ssr/hydrate.js +0 -49
  215. package/dist/ssr/hydrate.js.map +0 -1
  216. package/dist/ssr/ssr-collector-ref.js +0 -12
  217. package/dist/ssr/ssr-collector-ref.js.map +0 -1
  218. package/dist/states/index.d.ts +0 -49
  219. package/dist/states/index.js +0 -170
  220. package/dist/states/index.js.map +0 -1
  221. package/dist/static/tastyStatic.d.ts +0 -46
  222. package/dist/static/tastyStatic.js +0 -30
  223. package/dist/static/tastyStatic.js.map +0 -1
  224. package/dist/static/types.d.ts +0 -49
  225. package/dist/static/types.js +0 -24
  226. package/dist/static/types.js.map +0 -1
  227. package/dist/styles/border.d.ts +0 -25
  228. package/dist/styles/border.js +0 -120
  229. package/dist/styles/border.js.map +0 -1
  230. package/dist/styles/color.d.ts +0 -14
  231. package/dist/styles/color.js +0 -26
  232. package/dist/styles/color.js.map +0 -1
  233. package/dist/styles/const.js +0 -17
  234. package/dist/styles/const.js.map +0 -1
  235. package/dist/styles/createStyle.js +0 -79
  236. package/dist/styles/createStyle.js.map +0 -1
  237. package/dist/styles/dimension.js +0 -109
  238. package/dist/styles/dimension.js.map +0 -1
  239. package/dist/styles/directional.js +0 -133
  240. package/dist/styles/directional.js.map +0 -1
  241. package/dist/styles/display.d.ts +0 -30
  242. package/dist/styles/display.js +0 -73
  243. package/dist/styles/display.js.map +0 -1
  244. package/dist/styles/fade.d.ts +0 -15
  245. package/dist/styles/fade.js +0 -62
  246. package/dist/styles/fade.js.map +0 -1
  247. package/dist/styles/fill.d.ts +0 -42
  248. package/dist/styles/fill.js +0 -51
  249. package/dist/styles/fill.js.map +0 -1
  250. package/dist/styles/flow.d.ts +0 -16
  251. package/dist/styles/flow.js +0 -12
  252. package/dist/styles/flow.js.map +0 -1
  253. package/dist/styles/gap.d.ts +0 -31
  254. package/dist/styles/gap.js +0 -38
  255. package/dist/styles/gap.js.map +0 -1
  256. package/dist/styles/height.d.ts +0 -17
  257. package/dist/styles/height.js +0 -19
  258. package/dist/styles/height.js.map +0 -1
  259. package/dist/styles/index.d.ts +0 -1
  260. package/dist/styles/index.js +0 -8
  261. package/dist/styles/index.js.map +0 -1
  262. package/dist/styles/inset.d.ts +0 -24
  263. package/dist/styles/inset.js +0 -34
  264. package/dist/styles/inset.js.map +0 -1
  265. package/dist/styles/list.d.ts +0 -16
  266. package/dist/styles/list.js +0 -100
  267. package/dist/styles/list.js.map +0 -1
  268. package/dist/styles/margin.d.ts +0 -24
  269. package/dist/styles/margin.js +0 -32
  270. package/dist/styles/margin.js.map +0 -1
  271. package/dist/styles/outline.d.ts +0 -29
  272. package/dist/styles/outline.js +0 -55
  273. package/dist/styles/outline.js.map +0 -1
  274. package/dist/styles/padding.d.ts +0 -24
  275. package/dist/styles/padding.js +0 -32
  276. package/dist/styles/padding.js.map +0 -1
  277. package/dist/styles/placement.d.ts +0 -37
  278. package/dist/styles/placement.js +0 -74
  279. package/dist/styles/placement.js.map +0 -1
  280. package/dist/styles/predefined.d.ts +0 -71
  281. package/dist/styles/predefined.js +0 -237
  282. package/dist/styles/predefined.js.map +0 -1
  283. package/dist/styles/preset.d.ts +0 -52
  284. package/dist/styles/preset.js +0 -127
  285. package/dist/styles/preset.js.map +0 -1
  286. package/dist/styles/radius.d.ts +0 -12
  287. package/dist/styles/radius.js +0 -83
  288. package/dist/styles/radius.js.map +0 -1
  289. package/dist/styles/scrollMargin.d.ts +0 -24
  290. package/dist/styles/scrollMargin.js +0 -32
  291. package/dist/styles/scrollMargin.js.map +0 -1
  292. package/dist/styles/scrollbar.d.ts +0 -25
  293. package/dist/styles/scrollbar.js +0 -51
  294. package/dist/styles/scrollbar.js.map +0 -1
  295. package/dist/styles/shadow.d.ts +0 -14
  296. package/dist/styles/shadow.js +0 -25
  297. package/dist/styles/shadow.js.map +0 -1
  298. package/dist/styles/shared.js +0 -17
  299. package/dist/styles/shared.js.map +0 -1
  300. package/dist/styles/transition.d.ts +0 -14
  301. package/dist/styles/transition.js +0 -159
  302. package/dist/styles/transition.js.map +0 -1
  303. package/dist/styles/types.d.ts +0 -564
  304. package/dist/styles/width.d.ts +0 -17
  305. package/dist/styles/width.js +0 -19
  306. package/dist/styles/width.js.map +0 -1
  307. package/dist/tasty.d.ts +0 -134
  308. package/dist/tasty.js +0 -240
  309. package/dist/tasty.js.map +0 -1
  310. package/dist/types.d.ts +0 -184
  311. package/dist/utils/cache-wrapper.js +0 -21
  312. package/dist/utils/cache-wrapper.js.map +0 -1
  313. package/dist/utils/case-converter.js +0 -8
  314. package/dist/utils/case-converter.js.map +0 -1
  315. package/dist/utils/color-math.d.ts +0 -46
  316. package/dist/utils/color-math.js +0 -749
  317. package/dist/utils/color-math.js.map +0 -1
  318. package/dist/utils/color-space.d.ts +0 -5
  319. package/dist/utils/color-space.js +0 -228
  320. package/dist/utils/color-space.js.map +0 -1
  321. package/dist/utils/colors.d.ts +0 -5
  322. package/dist/utils/colors.js +0 -10
  323. package/dist/utils/colors.js.map +0 -1
  324. package/dist/utils/css-types.d.ts +0 -7
  325. package/dist/utils/dotize.d.ts +0 -26
  326. package/dist/utils/dotize.js +0 -122
  327. package/dist/utils/dotize.js.map +0 -1
  328. package/dist/utils/filter-base-props.d.ts +0 -15
  329. package/dist/utils/filter-base-props.js +0 -45
  330. package/dist/utils/filter-base-props.js.map +0 -1
  331. package/dist/utils/get-display-name.d.ts +0 -7
  332. package/dist/utils/get-display-name.js +0 -10
  333. package/dist/utils/get-display-name.js.map +0 -1
  334. package/dist/utils/has-keys.js +0 -13
  335. package/dist/utils/has-keys.js.map +0 -1
  336. package/dist/utils/is-dev-env.js +0 -19
  337. package/dist/utils/is-dev-env.js.map +0 -1
  338. package/dist/utils/is-valid-element-type.js +0 -15
  339. package/dist/utils/is-valid-element-type.js.map +0 -1
  340. package/dist/utils/merge-styles.js.map +0 -1
  341. package/dist/utils/mod-attrs.d.ts +0 -6
  342. package/dist/utils/mod-attrs.js +0 -20
  343. package/dist/utils/mod-attrs.js.map +0 -1
  344. package/dist/utils/process-tokens.d.ts +0 -17
  345. package/dist/utils/process-tokens.js +0 -83
  346. package/dist/utils/process-tokens.js.map +0 -1
  347. package/dist/utils/resolve-recipes.d.ts +0 -17
  348. package/dist/utils/resolve-recipes.js.map +0 -1
  349. package/dist/utils/selector-transform.js +0 -32
  350. package/dist/utils/selector-transform.js.map +0 -1
  351. package/dist/utils/string.js +0 -8
  352. package/dist/utils/string.js.map +0 -1
  353. package/dist/utils/styles.d.ts +0 -99
  354. package/dist/utils/styles.js +0 -220
  355. package/dist/utils/styles.js.map +0 -1
  356. package/dist/utils/typography.d.ts +0 -47
  357. package/dist/utils/typography.js +0 -51
  358. package/dist/utils/typography.js.map +0 -1
  359. package/dist/utils/warnings.d.ts +0 -16
  360. package/dist/utils/warnings.js +0 -16
  361. package/dist/utils/warnings.js.map +0 -1
  362. package/dist/zero/css-writer.d.ts +0 -45
  363. package/dist/zero/css-writer.js +0 -73
  364. package/dist/zero/css-writer.js.map +0 -1
  365. package/dist/zero/extractor.d.ts +0 -24
  366. package/dist/zero/extractor.js.map +0 -1
  367. package/docs/PIPELINE.md +0 -519
  368. /package/dist/{chunks/cacheKey.d.ts → ssr/astro-client.d.ts} +0 -0
package/docs/styles.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Style Properties Reference
2
2
 
3
- All standard CSS properties are supported in Tasty and benefit from its syntax sugar: design tokens (`$name`, `#name`), custom units (`2x`, `1r`, `1bw`), color opacity (`#purple.5`), auto-calc (`(100% - 2x)`), and custom functions. Values are parsed through the Tasty engine automatically.
3
+ All standard CSS properties are supported in Tasty and benefit from its syntax sugar: design tokens (`$name`, `#name`), custom units (`2x`, `1r`, `1bw`), color opacity (`#purple.5`), auto-calc (`(100% - 2x)`), and [custom functions](dsl.md#functions-function) (`$$negative(10px)`). Values are parsed through the Tasty engine automatically.
4
4
 
5
5
  The properties documented below have **custom handlers** with enhanced syntax. They should be **preferred** over their raw CSS equivalents because they:
6
6
 
@@ -100,18 +100,23 @@ For flex/grid layouts, outputs native `gap`. For block layouts, emulates gap usi
100
100
 
101
101
  Element padding with directional modifiers and multi-group support. Use **comma-separated groups** to set a base value and then override specific directions.
102
102
 
103
- **Syntax:** `[value]` | `[top right]` | `[top right bottom left]` | `[value directions...]` — comma-separated for multiple groups
103
+ **Syntax:** `[value]` | `[block inline]` | `[top right bottom left]` | `[value direction...]` — comma-separated for multiple groups
104
104
 
105
105
  **Direction modifiers:** `top`, `right`, `bottom`, `left`
106
106
 
107
107
  **Output modifier:** `longhand` — forces output as individual CSS longhand properties (`padding-top`, `padding-right`, `padding-bottom`, `padding-left`) instead of the `padding` shorthand. Useful when children need to selectively inherit individual directions.
108
108
 
109
+ **One value per directional group.** A group that names direction modifiers takes **exactly one** value, applied to every direction it names. For different values per side, use comma-separated groups: `padding: '2x top, 4x right'`. Writing `padding: '2x 4x top right'` ignores `4x` and warns in development — the parser keeps values and modifiers in separate buckets, so their interleaving in the source is not recoverable and `'2x 4x top right'`, `'2x top 4x right'` and `'top 2x right 4x'` are all the same input.
110
+
111
+ A group that names *no* direction keeps plain CSS shorthand order, which is unambiguous and unchanged.
112
+
109
113
  | Value | Effect |
110
114
  |-------|--------|
111
115
  | `"2x"` | All sides `2x` |
112
116
  | `"2x 1x"` | Top/bottom `2x`, left/right `1x` |
113
117
  | `"2x top"` | Top `2x`, right/bottom/left `0` |
114
118
  | `"1x left right"` | Left and right `1x`, top/bottom `0` |
119
+ | `"2x top, 4x right"` | Top `2x`, right `4x`, bottom/left `0` |
115
120
  | `"1x, 2x top"` | All sides `1x`, then top overridden to `2x` |
116
121
  | `"1x, 2x top bottom"` | Left/right `1x`, top/bottom `2x` |
117
122
  | `"2x longhand"` | All sides `2x`, output as 4 individual `padding-*` properties |
@@ -128,17 +133,20 @@ Individual props `paddingTop`, `paddingRight`, `paddingBottom`, `paddingLeft`, `
128
133
 
129
134
  Element margin. Same syntax, modifiers, and multi-group support as `padding`.
130
135
 
131
- **Syntax:** `[value]` | `[top right]` | `[top right bottom left]` | `[value directions...]` — comma-separated for multiple groups
136
+ **Syntax:** `[value]` | `[block inline]` | `[top right bottom left]` | `[value direction...]` — comma-separated for multiple groups
132
137
 
133
138
  **Direction modifiers:** `top`, `right`, `bottom`, `left`
134
139
 
135
140
  **Output modifier:** `longhand` — forces output as individual CSS longhand properties (`margin-top`, etc.) instead of the `margin` shorthand.
136
141
 
142
+ The [one-value-per-directional-group rule](#padding) from `padding` applies here too.
143
+
137
144
  | Value | Effect |
138
145
  |-------|--------|
139
146
  | `"2x"` | All sides `2x` |
140
147
  | `"2x 1x"` | Top/bottom `2x`, left/right `1x` |
141
148
  | `"2x top"` | Top `2x`, right/bottom/left `0` |
149
+ | `"2x top, 4x right"` | Top `2x`, right `4x`, bottom/left `0` |
142
150
  | `"auto left right, 1x top bottom"` | Left/right `auto`, top/bottom `1x` |
143
151
  | `true` | All sides `1x` |
144
152
  | Number | Converted to `px` |
@@ -191,10 +199,23 @@ Separate `minHeight` and `maxHeight` props are supported and override values fro
191
199
 
192
200
  Positioning offsets with directional modifiers and multi-group support. Same directional syntax as `padding`.
193
201
 
194
- **Syntax:** `[value]` | `[top right]` | `[top right bottom left]` | `[value directions...]` — comma-separated for multiple groups
202
+ **Syntax:** `[value]` | `[block inline]` | `[top right bottom left]` | `[value direction...]` — comma-separated for multiple groups
195
203
 
196
204
  **Direction modifiers:** `top`, `right`, `bottom`, `left`
197
205
 
206
+ The [one-value-per-directional-group rule](#padding) from `padding` applies here too, with `dock`
207
+ as the single exception.
208
+
209
+ **`dock` modifier:** pins the named edge and spans its full length, by also applying the value
210
+ to the two perpendicular sides. `inset: 'bottom dock'` gives `inset: auto 0 0 0` — anchored to
211
+ the bottom, full width. Without a direction, `dock` fills every side.
212
+
213
+ `dock` is the one place a directional group takes **two** values: the first insets the named
214
+ edge, the second the sides it spans. `inset: '2x 4x bottom dock'` pins the bottom at `2x` and
215
+ insets the sides by `4x`. A third value, or a second value without `dock`, is ignored and warns
216
+ in development. With several directions the first value applies to each named edge and the
217
+ second to every side they span.
218
+
198
219
  **Output modifier:** `longhand` — forces output as individual CSS properties (`top`, `right`, `bottom`, `left`) instead of the `inset` shorthand.
199
220
 
200
221
  | Value | Effect |
@@ -205,6 +226,11 @@ Positioning offsets with directional modifiers and multi-group support. Same dir
205
226
  | `"0, 2x top"` | All sides `0`, then top overridden to `2x` |
206
227
  | `"0 longhand"` | All sides `0`, output as individual `top`/`right`/`bottom`/`left` |
207
228
  | `true` | All sides `0` |
229
+ | `"bottom dock"` | Bottom/left/right `0`, top `auto` — bottom-anchored, full width |
230
+ | `"right dock"` | Right/top/bottom `0`, left `auto` — right-anchored, full height |
231
+ | `"2x bottom dock"` | Bottom/left/right `2x`, top `auto` |
232
+ | `"2x 4x bottom dock"` | Bottom `2x`, left/right `4x`, top `auto` |
233
+ | `"dock"` | All sides `0` |
208
234
 
209
235
  Later comma-separated groups override earlier groups for conflicting directions.
210
236
 
@@ -228,6 +254,7 @@ Background color with design token support. Preferred over `backgroundColor` and
228
254
  | `"#purple.10"` | Token color at 10% opacity |
229
255
  | `"#surface #primary.10"` | Background `#surface` with `#primary.10` overlay (two colors enable smooth transitions between both) |
230
256
  | `"rgb(255 128 0)"` | CSS color value |
257
+ | `"color-mix(in oklab, #primary 50%, #surface)"` | CSS color function — see [CSS Color Functions](dsl.md#css-color-functions) |
231
258
  | `true` | Default fill color |
232
259
 
233
260
  When two colors are provided, the first sets the background color and the second is applied as an overlay gradient layer. This enables independent CSS transitions on each color. The overlay is only applied when no explicit `image` or `backgroundImage` is set.
@@ -260,9 +287,17 @@ Text color with design token support.
260
287
  | `"#current"` | Current inherited color |
261
288
  | `"#current.5"` | Current inherited color at 50% opacity |
262
289
  | `"(#primary, #secondary)"` | Fallback: use `#primary`, fall back to `#secondary` |
290
+ | `"light-dark(#dark, #light)"` | CSS color function — see [CSS Color Functions](dsl.md#css-color-functions) |
263
291
  | `true` | `currentColor` |
264
292
 
265
- When set to a named color token, also sets `$current-color` and `$current-color-{colorSpace}` custom properties for downstream use (suffix depends on the configured `colorSpace`, default `oklch`).
293
+ Also sets `$current-color` to the same color, for anything that needs the
294
+ inherited color as a color rather than as the `currentcolor` keyword. Every color
295
+ publishes it, not just a named token, so a reader below always takes the nearest
296
+ `color` rather than the nearest *token* color. A value that already reads the
297
+ inherited color — `#current` itself, a `#current` fade, a bare `currentColor` —
298
+ is not republished: resolving it a second time one level down would fade it
299
+ twice, and the variable into itself is a self-reference. `#current` does not go
300
+ through it; it is the keyword.
266
301
 
267
302
  ### `svgFill`
268
303
 
@@ -270,7 +305,7 @@ SVG fill color. Same color token syntax as `fill` and `color`. Outputs the nativ
270
305
 
271
306
  ```jsx
272
307
  svgFill="#purple.10"
273
- svgFill="currentColor"
308
+ svgFill="#current"
274
309
  ```
275
310
 
276
311
  ---
@@ -319,7 +354,11 @@ Border radius with shape presets and directional modifiers.
319
354
  | `"backleaf"` | Asymmetric: round, sharp, round, sharp |
320
355
  | `"inherit"` | Inherit border-radius from parent |
321
356
 
322
- **Direction modifiers:** `top`, `right`, `bottom`, `left` — rounds only the specified corners.
357
+ **Edge modifiers:** `top`, `right`, `bottom`, `left` — rounds the *pair* of corners along that edge.
358
+
359
+ **Corner modifiers:** `top-left`, `top-right`, `bottom-right`, `bottom-left` — rounds a single corner.
360
+ Use these when an edge modifier would round one corner too many. Edge and corner modifiers combine
361
+ (`radius: 'top bottom-right'`).
323
362
 
324
363
  **Output modifier:** `longhand` — forces output as individual CSS longhand properties (`border-top-left-radius`, `border-top-right-radius`, `border-bottom-right-radius`, `border-bottom-left-radius`) instead of the `border-radius` shorthand. Useful when children need to selectively inherit individual corners via `radius: 'inherit left'`.
325
364
 
@@ -334,6 +373,9 @@ Border radius with shape presets and directional modifiers.
334
373
  | `"1r longhand"` | All corners `1r`, output as 4 individual `border-*-radius` properties |
335
374
  | `"inherit"` | All corners inherit from parent (`border-radius: inherit`) |
336
375
  | `"inherit right"` | Right corners inherit from parent (uses longhand properties) |
376
+ | `"top-right"` | Top-right corner `1r`, every other corner `0` |
377
+ | `"4px top-left"` | Top-left corner `4px`, every other corner `0` |
378
+ | `"top bottom-right"` | Both top corners and bottom-right `1r`, bottom-left `0` |
337
379
 
338
380
  ### `outline`
339
381
 
@@ -378,11 +420,11 @@ Multiple shadows: `shadow="1x 1x 2x #dark.20, inset 0 0 4x #dark.10"`
378
420
 
379
421
  Typography preset that sets font-size, line-height, letter-spacing, font-weight, font-style, and text-transform from named design tokens.
380
422
 
381
- **Syntax:** `name`, `name / modifier`, or `modifier` (shorthand)
423
+ **Syntax:** `name`, `name / modifier...`, or `modifier...` (shorthand)
382
424
 
383
425
  Preset names are project-specific (e.g. `h1`–`h6`, `t1`–`t4`, `p1`–`p4`). Register them for autocomplete by augmenting `TastyPresetNames`.
384
426
 
385
- Use `/` to separate the preset name from a modifier. When a modifier is used alone (without a name), the preset name defaults to `inherit`.
427
+ Use `/` to separate the preset name from one or more space-separated modifiers. When modifiers are used alone (without a name), the preset name defaults to `inherit`. Modifiers can be combined freely because they target different properties.
386
428
 
387
429
  **Modifiers:**
388
430
 
@@ -394,11 +436,13 @@ Use `/` to separate the preset name from a modifier. When a modifier is used alo
394
436
  | `tight` | Sets line-height equal to font-size |
395
437
 
396
438
  ```jsx
397
- preset="h1" // heading 1
398
- preset="h2 / strong" // bold heading 2
399
- preset="t3 / italic" // italic text 3
400
- preset="t2 / tight" // text 2 with tight line-height
401
- preset="bold" // inherit preset with bold (shorthand for "inherit / bold")
439
+ preset="h1" // heading 1
440
+ preset="h2 / strong" // bold heading 2
441
+ preset="h2 / strong italic" // bold + italic heading 2
442
+ preset="t3 / italic" // italic text 3
443
+ preset="t2 / strong tight" // bold text 2 with tight line-height
444
+ preset="bold" // inherit preset with bold (shorthand)
445
+ preset="bold italic" // inherit preset with bold + italic (shorthand)
402
446
  ```
403
447
 
404
448
  Individual typography props (`fontSize`, `lineHeight`, `letterSpacing`, `fontWeight`, `fontStyle`, `textTransform`) can be used alongside `preset` to override specific values, but using `preset` alone is recommended.
@@ -550,15 +594,20 @@ Scrollbar styling using CSS standard properties (`scrollbar-width`, `scrollbar-c
550
594
 
551
595
  Gradient-based edge fading using CSS masks. Use **comma-separated groups** to set different widths and colors per direction.
552
596
 
553
- **Syntax:** `[width] [directions...] [#from-color] [#to-color]` — comma-separated for multiple groups
597
+ **Syntax:** `[width] [direction...] [#from-color] [#to-color]` — comma-separated for multiple groups
554
598
 
555
599
  **Direction modifiers:** `top`, `right`, `bottom`, `left`
556
600
 
601
+ A group that names edges takes a **single** width, applied to every edge it names — different
602
+ widths per edge come from comma groups. A group that names no edge covers all four and keeps
603
+ plain CSS shorthand order, like `padding`. See the [`padding` rule](#padding).
604
+
557
605
  | Value | Effect |
558
606
  |-------|--------|
559
607
  | `"top"` | Fade top edge, default width (`2x`), all other edges unfaded |
560
608
  | `"2x left right"` | Fade left and right edges with `2x` width, top/bottom unfaded |
561
- | `"3x 1x top bottom"` | Fade top with `3x` width, bottom with `1x` width |
609
+ | `"3x 1x"` | All edges faded — top/bottom `3x`, left/right `1x` (CSS shorthand order) |
610
+ | `"3x top, 1x bottom"` | Fade top with `3x` width, bottom with `1x` width |
562
611
  | `"2x #transparent #dark"` | All edges faded with `2x` width, from `#transparent` to `#dark` |
563
612
  | `"top #a #b, bottom #c #d"` | Top fades from `#a` to `#b`, bottom fades from `#c` to `#d` |
564
613
 
@@ -1,6 +1,8 @@
1
- # Zero Runtime Mode (tastyStatic)
1
+ # Build-Time Extraction (`tastyStatic`)
2
2
 
3
- `tastyStatic` is a build-time utility for generating CSS with zero runtime overhead. It's designed for static sites, no-JS websites, and performance-critical applications where you want to eliminate all runtime styling code. For the broader docs map, see the [Docs Hub](README.md).
3
+ `tastyStatic` is Tasty's framework-agnostic build-time utility for extracting CSS before rendering. It produces no client styling runtime in file mode, but it is not the only way to achieve zero-runtime delivery: server-only `tasty()` also ships no Tasty runtime to the browser while retaining the full React component API. Astro's `tastyIntegration({ islands: false })` is the clearest example; the same architecture applies to server-only Next.js RSC.
4
+
5
+ Choose `tastyStatic` specifically when styles must be generated during the build, when the consumer is not React, or when you want static class-name objects instead of components. For the broader docs map, see the [Docs Hub](README.md).
4
6
 
5
7
  ---
6
8
 
@@ -8,19 +10,19 @@
8
10
 
9
11
  - **Static site generation (SSG)** — Pre-render all styles at build time
10
12
  - **No-JavaScript websites** — CSS works without any JS runtime
11
- - **Performance-critical pages** — Zero runtime overhead for styling
13
+ - **Performance-critical pages** — CSS extracted before the application renders
12
14
  - **Landing pages** — Minimal bundle size with pre-generated CSS
13
15
 
14
16
  ## Requirements
15
17
 
16
- The zero-runtime mode is part of the main `@tenphi/tasty` package but requires additional peer dependencies depending on your setup:
18
+ Build-time extraction is part of the main `@tenphi/tasty` package but requires additional peer dependencies depending on your setup:
17
19
 
18
- | Dependency | Version | Required for |
19
- |---|---|---|
20
- | `@babel/core` | >= 7.24 | Babel plugin (`@tenphi/tasty/babel-plugin`) |
21
- | `@babel/helper-plugin-utils` | >= 7.24 | Babel plugin |
22
- | `@babel/types` | >= 7.24 | Babel plugin |
23
- | `jiti` | >= 2.6 | Next.js wrapper (`@tenphi/tasty/next`) when using `configFile` option |
20
+ | Dependency | Version | Required for |
21
+ | ---------------------------- | ------- | -------------------------------------------------------------------------- |
22
+ | `@babel/core` | >= 7.24 | Babel plugin (`@tenphi/tasty/babel-plugin`) |
23
+ | `@babel/helper-plugin-utils` | >= 7.24 | Babel plugin |
24
+ | `@babel/types` | >= 7.24 | Babel plugin |
25
+ | `jiti` | >= 2.6 | Next.js wrapper (`@tenphi/tasty/zero/next`) when using `configFile` option |
24
26
 
25
27
  All of these are declared as optional peer dependencies of `@tenphi/tasty`. Install only what your setup requires:
26
28
 
@@ -107,11 +109,11 @@ tastyStatic('body', {
107
109
 
108
110
  ## StaticStyle Object
109
111
 
110
- | Property | Type | Description |
111
- |----------|------|-------------|
112
- | `className` | `string` | Space-separated class names for use in JSX |
113
- | `styles` | `Styles` | The original (or merged) styles object |
114
- | `toString()` | `() => string` | Returns `className` for string coercion |
112
+ | Property | Type | Description |
113
+ | ------------ | -------------- | ------------------------------------------ |
114
+ | `className` | `string` | Space-separated class names for use in JSX |
115
+ | `styles` | `Styles` | The original (or merged) styles object |
116
+ | `toString()` | `() => string` | Returns `className` for string coercion |
115
117
 
116
118
  ---
117
119
 
@@ -123,49 +125,83 @@ tastyStatic('body', {
123
125
  // babel.config.js
124
126
  module.exports = {
125
127
  plugins: [
126
- ['@tenphi/tasty/babel-plugin', {
127
- output: 'public/tasty.css',
128
- }]
129
- ]
128
+ [
129
+ '@tenphi/tasty/babel-plugin',
130
+ {
131
+ output: 'public/tasty.css',
132
+ },
133
+ ],
134
+ ],
130
135
  };
131
136
  ```
132
137
 
133
- These examples use `data-schema="dark"` as the root-state convention. If your app already uses a different root attribute such as `data-theme`, keep the same alias pattern and swap the attribute name consistently in your zero-runtime config.
138
+ These examples use `data-schema="dark"` as the root-state convention. If your app already uses a different root attribute such as `data-theme`, keep the same alias pattern and swap the attribute name consistently in your build-time config.
134
139
 
135
140
  ### With Configuration
136
141
 
137
142
  ```javascript
138
143
  module.exports = {
139
144
  plugins: [
140
- ['@tenphi/tasty/babel-plugin', {
141
- output: 'public/tasty.css',
142
- config: {
143
- states: {
144
- '@mobile': '@media(w < 768px)',
145
- '@tablet': '@media(w < 1024px)',
146
- '@dark': '@root(schema=dark)',
145
+ [
146
+ '@tenphi/tasty/babel-plugin',
147
+ {
148
+ output: 'public/tasty.css',
149
+ config: {
150
+ states: {
151
+ '@mobile': '@media(w < 768px)',
152
+ '@tablet': '@media(w < 1024px)',
153
+ '@dark': '@root(schema=dark)',
154
+ },
155
+ devMode: true,
147
156
  },
148
- devMode: true,
149
157
  },
150
- }]
151
- ]
158
+ ],
159
+ ],
152
160
  };
153
161
  ```
154
162
 
155
163
  ### Plugin Options
156
164
 
157
- | Option | Type | Default | Description |
158
- |--------|------|---------|-------------|
159
- | `output` | `string` | `'tasty.css'` | Path for generated CSS file |
160
- | `mode` | `'file' \| 'inject'` | `'file'` | `'file'` writes CSS to disk; `'inject'` embeds CSS inline in JS (see [Inject Mode](#inject-mode)) |
161
- | `configFile` | `string` | — | Absolute path to a TS/JS module that default-exports a `TastyZeroConfig` object. JSON-serializable alternative to `config` — required for Turbopack. |
162
- | `config` | `TastyZeroConfig \| () => TastyZeroConfig` | `{}` | Inline config object or factory function. Takes precedence over `configFile`. |
163
- | `configDeps` | `string[]` | `[]` | Absolute file paths that affect config (for cache invalidation) |
164
- | `config.states` | `Record<string, string>` | `{}` | Predefined state aliases |
165
- | `config.devMode` | `boolean` | `false` | Add source comments to CSS |
166
- | `config.recipes` | `Record<string, RecipeStyles>` | `{}` | Predefined style recipes |
167
- | `config.fontFace` | `Record<string, FontFaceInput>` | — | Global `@font-face` definitions |
168
- | `config.counterStyle` | `Record<string, CounterStyleDescriptors>` | — | Global `@counter-style` definitions |
165
+ | Option | Type | Default | Description |
166
+ | -------------------------- | ------------------------------------------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
167
+ | `output` | `string` | `'tasty.css'` | Path for generated CSS file |
168
+ | `mode` | `'file' \| 'inject'` | `'file'` | `'file'` writes CSS to disk; `'inject'` embeds CSS inline in JS (see [Inject Mode](#inject-mode)) |
169
+ | `configFile` | `string` | — | Absolute path to a TS/JS module that default-exports a `TastyZeroConfig` object. JSON-serializable alternative to `config` — required for Turbopack. |
170
+ | `config` | `TastyZeroConfig \| () => TastyZeroConfig` | `{}` | Inline config object or factory function. Takes precedence over `configFile`. |
171
+ | `configDeps` | `string[]` | `[]` | Absolute file paths that affect config (for cache invalidation) |
172
+ | `injectImport` | `boolean` | `true` | Replace `@tenphi/tasty/static` imports with an import of the generated CSS file. Set to `false` to manage CSS imports manually. |
173
+ | `config.states` | `Record<string, string>` | `{}` | Predefined state aliases (e.g. `{ '@mobile': '@media(w < 768px)' }`) |
174
+ | `config.devMode` | `boolean` | `false` | Add source comments to CSS |
175
+ | `config.tokens` | `ConfigTokens` | — | Design tokens injected as CSS custom properties on `:root`. Values are parsed through the Tasty DSL. Supports state maps for responsive/themed tokens. |
176
+ | `config.replaceTokens` | `Record<string, string \| number>` | — | Parse-time token substitution. Keys use `$name` for custom properties and `#name` for color tokens. |
177
+ | `config.recipes` | `Record<string, RecipeStyles>` | `{}` | Predefined style recipes |
178
+ | `config.keyframes` | `Record<string, KeyframesSteps>` | — | Global `@keyframes` definitions available to all `tastyStatic` calls |
179
+ | `config.fontFaces` | `Record<string, FontFaceInput>` | — | Global `@font-face` definitions |
180
+ | `config.counterStyles` | `Record<string, CounterStyleDescriptors>` | — | Global `@counter-style` definitions |
181
+ | `config.units` | `Record<string, string \| UnitHandler>` | — | Custom units for the style parser (merged with built-ins). E.g. `{ em: 'em', vw: 'vw' }` |
182
+ | `config.functions` | `Record<string, FunctionDefinition \| Function>` | — | Custom functions (merged). Bare keys → parse functions; `$$name` keys → declarative CSS `@function` definitions |
183
+ | `config.polyfills` | `{ functions?: boolean }` | `{}` | Opt-in polyfills. `functions: true` inlines `@function` calls into plain CSS at build time |
184
+ | `config.plugins` | `TastyPlugin[]` | — | Plugins that extend tasty with custom functions, units, states, and handlers |
185
+ | `config.handlers` | `Record<string, StyleHandlerDefinition>` | — | Custom style handlers that transform style properties into CSS declarations |
186
+ | `config.presets` | `Record<string, TypographyPreset>` | — | Typography presets — shorthand for `generateTypographyTokens()`. Generated tokens merge under explicit `tokens`. |
187
+ | `config.globalStyles` | `Record<string, Styles>` | — | Global Tasty styles keyed by CSS selector. Supports the full style syntax. |
188
+ | `config.autoPropertyTypes` | `boolean` | `true` | Automatically infer and register CSS `@property` declarations from values |
189
+ | `config.parserCacheSize` | `number` | `1000` | Parser LRU cache size. Larger values improve performance for builds with many unique style values |
190
+ | `config.namePrefix` | `string` | `'ts'` | Prefix prepended to every generated identifier. Defaults to `'ts'` so static classes never collide with runtime (`'t'`) classes. See [Configuration: Name prefix](configuration.md#name-prefix). |
191
+
192
+ ### Coexisting with `tasty()`
193
+
194
+ When a page mixes `tastyStatic` with `tasty`, both must use **different** `namePrefix` values. The defaults handle this automatically (`'t'` for React rendering, `'ts'` for build-time extraction). If you customize one, customize the other:
195
+
196
+ ```ts
197
+ // tasty-zero.config.ts (Babel plugin)
198
+ export default { namePrefix: 'mbs' };
199
+ ```
200
+
201
+ ```ts
202
+ // app entry (`tasty()` configure)
203
+ configure({ namePrefix: 'mb' });
204
+ ```
169
205
 
170
206
  ---
171
207
 
@@ -177,16 +213,24 @@ Recipes work with `tastyStatic` the same way as with runtime `tasty`:
177
213
  // babel.config.js
178
214
  module.exports = {
179
215
  plugins: [
180
- ['@tenphi/tasty/babel-plugin', {
181
- output: 'public/tasty.css',
182
- config: {
183
- recipes: {
184
- card: { padding: '4x', fill: '#surface', radius: '1r', border: true },
185
- elevated: { shadow: '2x 2x 4x #shadow' },
216
+ [
217
+ '@tenphi/tasty/babel-plugin',
218
+ {
219
+ output: 'public/tasty.css',
220
+ config: {
221
+ recipes: {
222
+ card: {
223
+ padding: '4x',
224
+ fill: '#surface',
225
+ radius: '1r',
226
+ border: true,
227
+ },
228
+ elevated: { shadow: '2x 2x 4x #shadow' },
229
+ },
186
230
  },
187
231
  },
188
- }]
189
- ]
232
+ ],
233
+ ],
190
234
  };
191
235
  ```
192
236
 
@@ -198,7 +242,7 @@ const card = tastyStatic({
198
242
  color: '#text',
199
243
  });
200
244
 
201
- <div className={card}>Styled card</div>
245
+ <div className={card}>Styled card</div>;
202
246
  ```
203
247
 
204
248
  ---
@@ -209,7 +253,7 @@ The `withTastyZero` wrapper configures both **webpack** and **Turbopack** automa
209
253
 
210
254
  ```typescript
211
255
  // next.config.ts
212
- import { withTastyZero } from '@tenphi/tasty/next';
256
+ import { withTastyZero } from '@tenphi/tasty/zero/next';
213
257
 
214
258
  export default withTastyZero({
215
259
  output: 'public/tasty.css',
@@ -222,14 +266,14 @@ export default withTastyZero({
222
266
 
223
267
  ### `withTastyZero` Options
224
268
 
225
- | Option | Type | Default | Description |
226
- |--------|------|---------|-------------|
227
- | `output` | `string` | `'public/tasty.css'` | Output path for CSS relative to project root |
228
- | `mode` | `'file' \| 'inject'` | `'file'` | `'file'` writes CSS to disk; `'inject'` embeds CSS inline in JS |
229
- | `enabled` | `boolean` | `true` | Enable/disable the plugin |
230
- | `configFile` | `string` | — | Path to a TS/JS module that default-exports `TastyZeroConfig`. Recommended for Turbopack compatibility. |
231
- | `config` | `TastyZeroConfig` | — | Inline config object. For static configs that don't change during dev. |
232
- | `configDeps` | `string[]` | `[]` | Extra files the config depends on (for cache invalidation) |
269
+ | Option | Type | Default | Description |
270
+ | ------------ | -------------------- | -------------------- | ------------------------------------------------------------------------------------------------------- |
271
+ | `output` | `string` | `'public/tasty.css'` | Output path for CSS relative to project root |
272
+ | `mode` | `'file' \| 'inject'` | `'file'` | `'file'` writes CSS to disk; `'inject'` embeds CSS inline in JS |
273
+ | `enabled` | `boolean` | `true` | Enable/disable the plugin |
274
+ | `configFile` | `string` | — | Path to a TS/JS module that default-exports `TastyZeroConfig`. Recommended for Turbopack compatibility. |
275
+ | `config` | `TastyZeroConfig` | — | Inline config object. For static configs that don't change during dev. |
276
+ | `configDeps` | `string[]` | `[]` | Extra files the config depends on (for cache invalidation) |
233
277
 
234
278
  ### Turbopack Support
235
279
 
@@ -267,12 +311,15 @@ export default defineConfig({
267
311
  react({
268
312
  babel: {
269
313
  plugins: [
270
- ['@tenphi/tasty/babel-plugin', {
271
- output: 'public/tasty.css',
272
- config: {
273
- states: { '@mobile': '@media(w < 768px)' },
314
+ [
315
+ '@tenphi/tasty/babel-plugin',
316
+ {
317
+ output: 'public/tasty.css',
318
+ config: {
319
+ states: { '@mobile': '@media(w < 768px)' },
320
+ },
274
321
  },
275
- }],
322
+ ],
276
323
  ],
277
324
  },
278
325
  }),
@@ -306,7 +353,9 @@ export const Button = () => <button className={button}>Click</button>;
306
353
  const button = {
307
354
  className: 'ts3f2a1b ts8c4d2e',
308
355
  styles: { padding: '2x 4x', fill: '#purple', color: '#white' },
309
- toString() { return this.className; }
356
+ toString() {
357
+ return this.className;
358
+ },
310
359
  };
311
360
 
312
361
  export const Button = () => <button className={button}>Click</button>;
@@ -354,13 +403,16 @@ This is ideal for **reusable components**, **extensions**, and **libraries** whe
354
403
  // babel.config.js
355
404
  module.exports = {
356
405
  plugins: [
357
- ['@tenphi/tasty/babel-plugin', {
358
- mode: 'inject',
359
- config: {
360
- states: { '@mobile': '@media(w < 768px)' },
406
+ [
407
+ '@tenphi/tasty/babel-plugin',
408
+ {
409
+ mode: 'inject',
410
+ config: {
411
+ states: { '@mobile': '@media(w < 768px)' },
412
+ },
361
413
  },
362
- }]
363
- ]
414
+ ],
415
+ ],
364
416
  };
365
417
  ```
366
418
 
@@ -368,7 +420,7 @@ With Next.js:
368
420
 
369
421
  ```typescript
370
422
  // next.config.ts
371
- import { withTastyZero } from '@tenphi/tasty/next';
423
+ import { withTastyZero } from '@tenphi/tasty/zero/next';
372
424
 
373
425
  export default withTastyZero({
374
426
  mode: 'inject',
@@ -400,13 +452,20 @@ tastyStatic('.heading', { preset: 'h1' });
400
452
  ```tsx
401
453
  import { injectCSS as _$i } from '@tenphi/tasty/static/inject';
402
454
 
403
- const button = (_$i("ts3f2a1b ts8c4d2e", ".ts3f2a1b.ts3f2a1b{padding:16px 32px}\n.ts8c4d2e.ts8c4d2e{background:#9370db}"), {
404
- className: 'ts3f2a1b ts8c4d2e',
405
- styles: { padding: '2x 4x', fill: '#purple' },
406
- toString() { return this.className; }
407
- });
408
-
409
- _$i(".heading", ".heading{font-size:2.5rem;font-weight:700;line-height:1.2}");
455
+ const button =
456
+ (_$i(
457
+ 'ts3f2a1b ts8c4d2e',
458
+ '.ts3f2a1b.ts3f2a1b{padding:16px 32px}\n.ts8c4d2e.ts8c4d2e{background:#9370db}',
459
+ ),
460
+ {
461
+ className: 'ts3f2a1b ts8c4d2e',
462
+ styles: { padding: '2x 4x', fill: '#purple' },
463
+ toString() {
464
+ return this.className;
465
+ },
466
+ });
467
+
468
+ _$i('.heading', '.heading{font-size:2.5rem;font-weight:700;line-height:1.2}');
410
469
  ```
411
470
 
412
471
  ### Dev Mode / HMR
@@ -415,7 +474,7 @@ Class names are content-hashed (`ts` + MD5). When styles change, a new hash prod
415
474
 
416
475
  ### Limitations (inject mode)
417
476
 
418
- - **Client-side only** — Styles are injected via the DOM, so they are not available during SSR. For server-rendered apps, use `mode: 'file'` or the runtime `tasty()`.
477
+ - **Client-side only** — Styles are injected via the DOM, so they are not available during SSR. For server-rendered apps, use `mode: 'file'` or React `tasty()`.
419
478
  - **Larger JS bundle** — CSS is embedded in JavaScript, increasing bundle size. Best suited for components and extensions, not full-app styling.
420
479
 
421
480
  ---
@@ -484,13 +543,15 @@ For dynamic styling needs, combine with regular CSS or CSS variables:
484
543
  ```tsx
485
544
  const card = tastyStatic({
486
545
  padding: '4x',
487
- fill: 'var(--card-bg, #white)',
546
+ fill: '($card-bg, #white)',
488
547
  });
489
548
 
490
549
  <div
491
550
  className={card}
492
- style={{ '--card-bg': isActive ? '#purple' : '#white' }}
493
- />
551
+ style={{
552
+ '--card-bg': isActive ? 'var(--purple-color)' : 'var(--white-color)',
553
+ }}
554
+ />;
494
555
  ```
495
556
 
496
557
  ---
@@ -507,14 +568,15 @@ const card = tastyStatic({
507
568
  ## Common Issues
508
569
 
509
570
  - No CSS file is generated: make sure the Babel plugin actually runs for files importing `@tenphi/tasty/static`, and verify the `output` path is writable.
510
- - Styles stay dynamic by mistake: `tastyStatic()` only supports build-time-known values. Move runtime values to CSS variables or switch that component to runtime `tasty()`.
571
+ - Styles stay dynamic by mistake: `tastyStatic()` only supports build-time-known values. Move dynamic values to CSS variables or switch that component to React `tasty()`.
511
572
  - Turbopack config behaves inconsistently: prefer `configFile` over inline functions so the setup stays JSON-serializable.
512
573
 
513
574
  ---
514
575
 
515
576
  ## Related
516
577
 
517
- - [Docs Hub](README.md) — Choose the right guide by task or rendering mode
578
+ - [Docs Hub](README.md) — Choose the right guide by task or CSS delivery model
518
579
  - [Style DSL](dsl.md) — State maps, tokens, units, extending semantics (shared by runtime and static)
519
- - [Runtime API](runtime.md) — Runtime styling: `tasty()` factory, component props, variants, sub-elements, hooks
580
+ - [React API](react-api.md) — Client or server rendering with `tasty()`: component props, variants, sub-elements, and style functions
520
581
  - [Configuration](configuration.md) — Global configuration: tokens, recipes, custom units, and style handlers
582
+ - [Plugins & Extension Points](plugins.md) — Which extension points work at build time (`functions`, `units`, `states`, `handlers`, `recipes`) and which do not (`propHandlers` — `tastyStatic()` takes styles objects, not props)