@tenphi/tasty 0.0.0-snapshot.a7fb1f5 → 0.0.0-snapshot.a8a2a5d

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 (387) hide show
  1. package/README.md +453 -360
  2. package/dist/babel-types-BOABQvEI.d.ts +16 -0
  3. package/dist/chunks/async-storage-CzSKAyrI.js +36 -0
  4. package/dist/chunks/async-storage-CzSKAyrI.js.map +1 -0
  5. package/dist/chunks/build-config-DQkT3Wru.js +59 -0
  6. package/dist/chunks/build-config-DQkT3Wru.js.map +1 -0
  7. package/dist/chunks/collector-Df9zcabl.js +209 -0
  8. package/dist/chunks/collector-Df9zcabl.js.map +1 -0
  9. package/dist/chunks/config-engine-C7OUmM1J.js +269 -0
  10. package/dist/chunks/config-engine-C7OUmM1J.js.map +1 -0
  11. package/dist/chunks/config-file-BX3F_61U.js +24 -0
  12. package/dist/chunks/config-file-BX3F_61U.js.map +1 -0
  13. package/dist/chunks/css-definitions-BkdTqT7G.js +896 -0
  14. package/dist/chunks/css-definitions-BkdTqT7G.js.map +1 -0
  15. package/dist/chunks/css-resources-C0zT36nQ.js +141 -0
  16. package/dist/chunks/css-resources-C0zT36nQ.js.map +1 -0
  17. package/dist/{debug.js → chunks/debug-CwGMB2RI.js} +197 -149
  18. package/dist/chunks/debug-CwGMB2RI.js.map +1 -0
  19. package/dist/chunks/dsl-BAwiOznp.js +1442 -0
  20. package/dist/chunks/dsl-BAwiOznp.js.map +1 -0
  21. package/dist/chunks/hydration-DEmoq1sQ.js +39 -0
  22. package/dist/chunks/hydration-DEmoq1sQ.js.map +1 -0
  23. package/dist/chunks/react-runtime-B8YqpFx7.js +678 -0
  24. package/dist/chunks/react-runtime-B8YqpFx7.js.map +1 -0
  25. package/dist/chunks/runtime-engine-CHNH2nGy.js +2418 -0
  26. package/dist/chunks/runtime-engine-CHNH2nGy.js.map +1 -0
  27. package/dist/chunks/runtime-state-BxLKsQzs.js +150 -0
  28. package/dist/chunks/runtime-state-BxLKsQzs.js.map +1 -0
  29. package/dist/{utils/merge-styles.js → chunks/shared-utils-CYgOs2mp.js} +58 -58
  30. package/dist/chunks/shared-utils-CYgOs2mp.js.map +1 -0
  31. package/dist/chunks/style-engine-DkKH-TqL.js +5573 -0
  32. package/dist/chunks/style-engine-DkKH-TqL.js.map +1 -0
  33. package/dist/chunks/zero-engine-C-0ar_PT.js +308 -0
  34. package/dist/chunks/zero-engine-C-0ar_PT.js.map +1 -0
  35. package/dist/collector-BN6hCWIx.d.ts +160 -0
  36. package/dist/config-Chmu-PnP.d.ts +1349 -0
  37. package/dist/core/index.d.ts +5 -34
  38. package/dist/core/index.js +9 -27
  39. package/dist/hydrate-CTh8SGd9.d.ts +20 -0
  40. package/dist/index-szujmf6W.d.ts +1848 -0
  41. package/dist/index.d.ts +5 -51
  42. package/dist/index.js +11 -36
  43. package/dist/merge-styles-Cx25bpax.d.ts +4 -0
  44. package/dist/ssr/astro-client.d.ts +1 -0
  45. package/dist/ssr/astro-client.js +5 -0
  46. package/dist/ssr/astro-client.js.map +1 -0
  47. package/dist/ssr/astro-middleware-extract-static.d.ts +8 -0
  48. package/dist/ssr/astro-middleware-extract-static.js +8 -0
  49. package/dist/ssr/astro-middleware-extract-static.js.map +1 -0
  50. package/dist/ssr/astro-middleware-extract.d.ts +8 -0
  51. package/dist/ssr/astro-middleware-extract.js +8 -0
  52. package/dist/ssr/astro-middleware-extract.js.map +1 -0
  53. package/dist/ssr/astro-middleware-static.d.ts +15 -0
  54. package/dist/ssr/astro-middleware-static.js +6 -0
  55. package/dist/ssr/astro-middleware-static.js.map +1 -0
  56. package/dist/ssr/astro-middleware.d.ts +16 -0
  57. package/dist/ssr/astro-middleware.js +6 -0
  58. package/dist/ssr/astro-middleware.js.map +1 -0
  59. package/dist/ssr/astro.d.ts +110 -14
  60. package/dist/ssr/astro.js +205 -50
  61. package/dist/ssr/astro.js.map +1 -1
  62. package/dist/ssr/client.d.ts +2 -0
  63. package/dist/ssr/client.js +1 -0
  64. package/dist/ssr/index.d.ts +15 -4
  65. package/dist/ssr/index.js +7 -8
  66. package/dist/ssr/index.js.map +1 -1
  67. package/dist/ssr/next-config.d.ts +63 -0
  68. package/dist/ssr/next-config.js +122 -0
  69. package/dist/ssr/next-config.js.map +1 -0
  70. package/dist/ssr/next.d.ts +13 -12
  71. package/dist/ssr/next.js +33 -48
  72. package/dist/ssr/next.js.map +1 -1
  73. package/dist/static/index.d.ts +86 -5
  74. package/dist/static/index.js +29 -3
  75. package/dist/static/index.js.map +1 -0
  76. package/dist/static/inject.d.ts +1 -4
  77. package/dist/static/inject.js +1 -2
  78. package/dist/static/inject.js.map +1 -1
  79. package/dist/types-DbMN-Yyn.d.ts +1545 -0
  80. package/dist/zero/babel.d.ts +12 -123
  81. package/dist/zero/babel.js +125 -151
  82. package/dist/zero/babel.js.map +1 -1
  83. package/dist/zero/index.d.ts +130 -3
  84. package/dist/zero/index.js +24 -3
  85. package/dist/zero/index.js.map +1 -0
  86. package/dist/zero/next.d.ts +5 -7
  87. package/dist/zero/next.js +4 -40
  88. package/dist/zero/next.js.map +1 -1
  89. package/docs/README.md +23 -12
  90. package/docs/adoption.md +72 -37
  91. package/docs/ai-agents.md +259 -0
  92. package/docs/comparison.md +83 -54
  93. package/docs/configuration.md +712 -81
  94. package/docs/debug.md +39 -24
  95. package/docs/design-system.md +186 -41
  96. package/docs/dsl.md +740 -197
  97. package/docs/getting-started.md +132 -52
  98. package/docs/injector.md +184 -92
  99. package/docs/llms.txt +31 -0
  100. package/docs/methodology.md +107 -50
  101. package/docs/migration-v3.md +285 -0
  102. package/docs/pipeline.md +768 -0
  103. package/docs/plugins.md +333 -0
  104. package/docs/react-api.md +746 -0
  105. package/docs/runtime-benchmarks.md +388 -0
  106. package/docs/ssr.md +399 -117
  107. package/docs/styles.md +234 -49
  108. package/docs/tasty-static.md +298 -118
  109. package/harness/dev.harnesspm/rules/usage.md +12 -0
  110. package/harness/dev.harnesspm/scripts/render.mjs +320 -0
  111. package/harness/dev.harnesspm/scripts/styles.mjs +299 -0
  112. package/harness/plugin.json +20 -0
  113. package/package.json +159 -44
  114. package/tasty.config.ts +7 -0
  115. package/dist/_virtual/_rolldown/runtime.js +0 -7
  116. package/dist/chunks/cacheKey.d.ts +0 -1
  117. package/dist/chunks/cacheKey.js +0 -77
  118. package/dist/chunks/cacheKey.js.map +0 -1
  119. package/dist/chunks/definitions.d.ts +0 -37
  120. package/dist/chunks/definitions.js +0 -258
  121. package/dist/chunks/definitions.js.map +0 -1
  122. package/dist/chunks/index.d.ts +0 -1
  123. package/dist/chunks/renderChunk.d.ts +0 -1
  124. package/dist/chunks/renderChunk.js +0 -59
  125. package/dist/chunks/renderChunk.js.map +0 -1
  126. package/dist/compute-styles.d.ts +0 -31
  127. package/dist/compute-styles.js +0 -357
  128. package/dist/compute-styles.js.map +0 -1
  129. package/dist/config.d.ts +0 -366
  130. package/dist/config.js +0 -502
  131. package/dist/config.js.map +0 -1
  132. package/dist/counter-style/index.js +0 -51
  133. package/dist/counter-style/index.js.map +0 -1
  134. package/dist/debug.d.ts +0 -89
  135. package/dist/debug.js.map +0 -1
  136. package/dist/font-face/index.js +0 -63
  137. package/dist/font-face/index.js.map +0 -1
  138. package/dist/hooks/index.d.ts +0 -7
  139. package/dist/hooks/useCounterStyle.d.ts +0 -50
  140. package/dist/hooks/useCounterStyle.js +0 -45
  141. package/dist/hooks/useCounterStyle.js.map +0 -1
  142. package/dist/hooks/useFontFace.d.ts +0 -43
  143. package/dist/hooks/useFontFace.js +0 -69
  144. package/dist/hooks/useFontFace.js.map +0 -1
  145. package/dist/hooks/useGlobalStyles.d.ts +0 -30
  146. package/dist/hooks/useGlobalStyles.js +0 -77
  147. package/dist/hooks/useGlobalStyles.js.map +0 -1
  148. package/dist/hooks/useKeyframes.d.ts +0 -56
  149. package/dist/hooks/useKeyframes.js +0 -63
  150. package/dist/hooks/useKeyframes.js.map +0 -1
  151. package/dist/hooks/useProperty.d.ts +0 -79
  152. package/dist/hooks/useProperty.js +0 -108
  153. package/dist/hooks/useProperty.js.map +0 -1
  154. package/dist/hooks/useRawCSS.d.ts +0 -53
  155. package/dist/hooks/useRawCSS.js +0 -34
  156. package/dist/hooks/useRawCSS.js.map +0 -1
  157. package/dist/hooks/useStyles.d.ts +0 -40
  158. package/dist/hooks/useStyles.js +0 -29
  159. package/dist/hooks/useStyles.js.map +0 -1
  160. package/dist/injector/index.d.ts +0 -187
  161. package/dist/injector/index.js +0 -192
  162. package/dist/injector/index.js.map +0 -1
  163. package/dist/injector/injector.d.ts +0 -195
  164. package/dist/injector/injector.js +0 -587
  165. package/dist/injector/injector.js.map +0 -1
  166. package/dist/injector/sheet-manager.d.ts +0 -132
  167. package/dist/injector/sheet-manager.js +0 -697
  168. package/dist/injector/sheet-manager.js.map +0 -1
  169. package/dist/injector/types.d.ts +0 -235
  170. package/dist/keyframes/index.js +0 -206
  171. package/dist/keyframes/index.js.map +0 -1
  172. package/dist/parser/classify.js +0 -319
  173. package/dist/parser/classify.js.map +0 -1
  174. package/dist/parser/const.js +0 -60
  175. package/dist/parser/const.js.map +0 -1
  176. package/dist/parser/lru.js +0 -109
  177. package/dist/parser/lru.js.map +0 -1
  178. package/dist/parser/parser.d.ts +0 -25
  179. package/dist/parser/parser.js +0 -115
  180. package/dist/parser/parser.js.map +0 -1
  181. package/dist/parser/tokenizer.js +0 -69
  182. package/dist/parser/tokenizer.js.map +0 -1
  183. package/dist/parser/types.d.ts +0 -51
  184. package/dist/parser/types.js +0 -46
  185. package/dist/parser/types.js.map +0 -1
  186. package/dist/pipeline/conditions.d.ts +0 -134
  187. package/dist/pipeline/conditions.js +0 -406
  188. package/dist/pipeline/conditions.js.map +0 -1
  189. package/dist/pipeline/exclusive.js +0 -230
  190. package/dist/pipeline/exclusive.js.map +0 -1
  191. package/dist/pipeline/index.d.ts +0 -55
  192. package/dist/pipeline/index.js +0 -708
  193. package/dist/pipeline/index.js.map +0 -1
  194. package/dist/pipeline/materialize.js +0 -1103
  195. package/dist/pipeline/materialize.js.map +0 -1
  196. package/dist/pipeline/parseStateKey.d.ts +0 -15
  197. package/dist/pipeline/parseStateKey.js +0 -446
  198. package/dist/pipeline/parseStateKey.js.map +0 -1
  199. package/dist/pipeline/simplify.js +0 -515
  200. package/dist/pipeline/simplify.js.map +0 -1
  201. package/dist/pipeline/warnings.js +0 -18
  202. package/dist/pipeline/warnings.js.map +0 -1
  203. package/dist/plugins/index.d.ts +0 -2
  204. package/dist/plugins/okhsl-plugin.d.ts +0 -35
  205. package/dist/plugins/okhsl-plugin.js +0 -97
  206. package/dist/plugins/okhsl-plugin.js.map +0 -1
  207. package/dist/plugins/types.d.ts +0 -76
  208. package/dist/properties/index.js +0 -222
  209. package/dist/properties/index.js.map +0 -1
  210. package/dist/properties/property-type-resolver.d.ts +0 -24
  211. package/dist/properties/property-type-resolver.js +0 -90
  212. package/dist/properties/property-type-resolver.js.map +0 -1
  213. package/dist/ssr/async-storage.d.ts +0 -17
  214. package/dist/ssr/async-storage.js +0 -34
  215. package/dist/ssr/async-storage.js.map +0 -1
  216. package/dist/ssr/collect-auto-properties.js +0 -39
  217. package/dist/ssr/collect-auto-properties.js.map +0 -1
  218. package/dist/ssr/collector.d.ts +0 -102
  219. package/dist/ssr/collector.js +0 -219
  220. package/dist/ssr/collector.js.map +0 -1
  221. package/dist/ssr/format-global-rules.js +0 -22
  222. package/dist/ssr/format-global-rules.js.map +0 -1
  223. package/dist/ssr/format-keyframes.js +0 -69
  224. package/dist/ssr/format-keyframes.js.map +0 -1
  225. package/dist/ssr/format-property.js +0 -49
  226. package/dist/ssr/format-property.js.map +0 -1
  227. package/dist/ssr/format-rules.js +0 -73
  228. package/dist/ssr/format-rules.js.map +0 -1
  229. package/dist/ssr/hydrate.d.ts +0 -22
  230. package/dist/ssr/hydrate.js +0 -49
  231. package/dist/ssr/hydrate.js.map +0 -1
  232. package/dist/ssr/ssr-collector-ref.js +0 -12
  233. package/dist/ssr/ssr-collector-ref.js.map +0 -1
  234. package/dist/states/index.d.ts +0 -49
  235. package/dist/states/index.js +0 -170
  236. package/dist/states/index.js.map +0 -1
  237. package/dist/static/tastyStatic.d.ts +0 -46
  238. package/dist/static/tastyStatic.js +0 -30
  239. package/dist/static/tastyStatic.js.map +0 -1
  240. package/dist/static/types.d.ts +0 -49
  241. package/dist/static/types.js +0 -24
  242. package/dist/static/types.js.map +0 -1
  243. package/dist/styles/border.d.ts +0 -25
  244. package/dist/styles/border.js +0 -120
  245. package/dist/styles/border.js.map +0 -1
  246. package/dist/styles/color.d.ts +0 -14
  247. package/dist/styles/color.js +0 -26
  248. package/dist/styles/color.js.map +0 -1
  249. package/dist/styles/const.js +0 -17
  250. package/dist/styles/const.js.map +0 -1
  251. package/dist/styles/createStyle.js +0 -79
  252. package/dist/styles/createStyle.js.map +0 -1
  253. package/dist/styles/dimension.js +0 -109
  254. package/dist/styles/dimension.js.map +0 -1
  255. package/dist/styles/directional.js +0 -133
  256. package/dist/styles/directional.js.map +0 -1
  257. package/dist/styles/display.d.ts +0 -30
  258. package/dist/styles/display.js +0 -73
  259. package/dist/styles/display.js.map +0 -1
  260. package/dist/styles/fade.d.ts +0 -15
  261. package/dist/styles/fade.js +0 -62
  262. package/dist/styles/fade.js.map +0 -1
  263. package/dist/styles/fill.d.ts +0 -42
  264. package/dist/styles/fill.js +0 -51
  265. package/dist/styles/fill.js.map +0 -1
  266. package/dist/styles/flow.d.ts +0 -16
  267. package/dist/styles/flow.js +0 -12
  268. package/dist/styles/flow.js.map +0 -1
  269. package/dist/styles/gap.d.ts +0 -31
  270. package/dist/styles/gap.js +0 -38
  271. package/dist/styles/gap.js.map +0 -1
  272. package/dist/styles/height.d.ts +0 -17
  273. package/dist/styles/height.js +0 -19
  274. package/dist/styles/height.js.map +0 -1
  275. package/dist/styles/index.d.ts +0 -1
  276. package/dist/styles/index.js +0 -8
  277. package/dist/styles/index.js.map +0 -1
  278. package/dist/styles/inset.d.ts +0 -24
  279. package/dist/styles/inset.js +0 -34
  280. package/dist/styles/inset.js.map +0 -1
  281. package/dist/styles/list.d.ts +0 -16
  282. package/dist/styles/list.js +0 -100
  283. package/dist/styles/list.js.map +0 -1
  284. package/dist/styles/margin.d.ts +0 -24
  285. package/dist/styles/margin.js +0 -32
  286. package/dist/styles/margin.js.map +0 -1
  287. package/dist/styles/outline.d.ts +0 -29
  288. package/dist/styles/outline.js +0 -55
  289. package/dist/styles/outline.js.map +0 -1
  290. package/dist/styles/padding.d.ts +0 -24
  291. package/dist/styles/padding.js +0 -32
  292. package/dist/styles/padding.js.map +0 -1
  293. package/dist/styles/placement.d.ts +0 -37
  294. package/dist/styles/placement.js +0 -74
  295. package/dist/styles/placement.js.map +0 -1
  296. package/dist/styles/predefined.d.ts +0 -71
  297. package/dist/styles/predefined.js +0 -237
  298. package/dist/styles/predefined.js.map +0 -1
  299. package/dist/styles/preset.d.ts +0 -52
  300. package/dist/styles/preset.js +0 -127
  301. package/dist/styles/preset.js.map +0 -1
  302. package/dist/styles/radius.d.ts +0 -12
  303. package/dist/styles/radius.js +0 -83
  304. package/dist/styles/radius.js.map +0 -1
  305. package/dist/styles/scrollMargin.d.ts +0 -24
  306. package/dist/styles/scrollMargin.js +0 -32
  307. package/dist/styles/scrollMargin.js.map +0 -1
  308. package/dist/styles/scrollbar.d.ts +0 -25
  309. package/dist/styles/scrollbar.js +0 -51
  310. package/dist/styles/scrollbar.js.map +0 -1
  311. package/dist/styles/shadow.d.ts +0 -14
  312. package/dist/styles/shadow.js +0 -25
  313. package/dist/styles/shadow.js.map +0 -1
  314. package/dist/styles/shared.js +0 -17
  315. package/dist/styles/shared.js.map +0 -1
  316. package/dist/styles/transition.d.ts +0 -14
  317. package/dist/styles/transition.js +0 -159
  318. package/dist/styles/transition.js.map +0 -1
  319. package/dist/styles/types.d.ts +0 -564
  320. package/dist/styles/width.d.ts +0 -17
  321. package/dist/styles/width.js +0 -19
  322. package/dist/styles/width.js.map +0 -1
  323. package/dist/tasty.d.ts +0 -134
  324. package/dist/tasty.js +0 -243
  325. package/dist/tasty.js.map +0 -1
  326. package/dist/types.d.ts +0 -184
  327. package/dist/utils/cache-wrapper.js +0 -21
  328. package/dist/utils/cache-wrapper.js.map +0 -1
  329. package/dist/utils/case-converter.js +0 -8
  330. package/dist/utils/case-converter.js.map +0 -1
  331. package/dist/utils/color-math.d.ts +0 -46
  332. package/dist/utils/color-math.js +0 -749
  333. package/dist/utils/color-math.js.map +0 -1
  334. package/dist/utils/color-space.d.ts +0 -5
  335. package/dist/utils/color-space.js +0 -228
  336. package/dist/utils/color-space.js.map +0 -1
  337. package/dist/utils/colors.d.ts +0 -5
  338. package/dist/utils/colors.js +0 -10
  339. package/dist/utils/colors.js.map +0 -1
  340. package/dist/utils/css-types.d.ts +0 -7
  341. package/dist/utils/dotize.d.ts +0 -26
  342. package/dist/utils/dotize.js +0 -122
  343. package/dist/utils/dotize.js.map +0 -1
  344. package/dist/utils/filter-base-props.d.ts +0 -15
  345. package/dist/utils/filter-base-props.js +0 -45
  346. package/dist/utils/filter-base-props.js.map +0 -1
  347. package/dist/utils/get-display-name.d.ts +0 -7
  348. package/dist/utils/get-display-name.js +0 -10
  349. package/dist/utils/get-display-name.js.map +0 -1
  350. package/dist/utils/has-keys.js +0 -13
  351. package/dist/utils/has-keys.js.map +0 -1
  352. package/dist/utils/is-dev-env.js +0 -19
  353. package/dist/utils/is-dev-env.js.map +0 -1
  354. package/dist/utils/is-valid-element-type.js +0 -15
  355. package/dist/utils/is-valid-element-type.js.map +0 -1
  356. package/dist/utils/merge-styles.d.ts +0 -7
  357. package/dist/utils/merge-styles.js.map +0 -1
  358. package/dist/utils/mod-attrs.d.ts +0 -6
  359. package/dist/utils/mod-attrs.js +0 -20
  360. package/dist/utils/mod-attrs.js.map +0 -1
  361. package/dist/utils/process-tokens.d.ts +0 -17
  362. package/dist/utils/process-tokens.js +0 -83
  363. package/dist/utils/process-tokens.js.map +0 -1
  364. package/dist/utils/resolve-recipes.d.ts +0 -17
  365. package/dist/utils/resolve-recipes.js +0 -146
  366. package/dist/utils/resolve-recipes.js.map +0 -1
  367. package/dist/utils/selector-transform.js +0 -32
  368. package/dist/utils/selector-transform.js.map +0 -1
  369. package/dist/utils/string.js +0 -8
  370. package/dist/utils/string.js.map +0 -1
  371. package/dist/utils/styles.d.ts +0 -99
  372. package/dist/utils/styles.js +0 -220
  373. package/dist/utils/styles.js.map +0 -1
  374. package/dist/utils/typography.d.ts +0 -47
  375. package/dist/utils/typography.js +0 -51
  376. package/dist/utils/typography.js.map +0 -1
  377. package/dist/utils/warnings.d.ts +0 -16
  378. package/dist/utils/warnings.js +0 -16
  379. package/dist/utils/warnings.js.map +0 -1
  380. package/dist/zero/css-writer.d.ts +0 -45
  381. package/dist/zero/css-writer.js +0 -73
  382. package/dist/zero/css-writer.js.map +0 -1
  383. package/dist/zero/extractor.d.ts +0 -24
  384. package/dist/zero/extractor.js +0 -266
  385. package/dist/zero/extractor.js.map +0 -1
  386. package/docs/PIPELINE.md +0 -519
  387. package/docs/runtime.md +0 -572
@@ -1,6 +1,8 @@
1
1
  # Methodology
2
2
 
3
- Tasty has opinions about how components should be structured. The patterns described here are not mandatory — Tasty works without them — but following them gets the most out of the engine: deterministic state resolution, cleaner component APIs, simpler overrides, and fewer surprises as the system grows.
3
+ State maps keep a property’s branches from fighting. This guide applies the same goal to component architecture: keep state ownership explicit, expose intentional public APIs, and make extension predictable as a component system grows.
4
+
5
+ The patterns are recommended rather than required. Tasty works without them, but they help design-system teams carry its state-resolution guarantees across roots, sub-elements, typed props, tokens, and styled wrappers.
4
6
 
5
7
  ---
6
8
 
@@ -75,7 +77,7 @@ const Nav = tasty({
75
77
  '': '#text',
76
78
  '@own(:hover)': '#primary',
77
79
  '@own(:focus-visible)': '#primary',
78
- 'selected': '#primary',
80
+ selected: '#primary',
79
81
  },
80
82
  },
81
83
  },
@@ -117,16 +119,17 @@ Style props accept state maps, so responsive values work through the same API:
117
119
 
118
120
  Tasty exports predefined style prop lists that group properties by role. Use them instead of hand-picking arrays:
119
121
 
120
- | Preset | Properties | Typical use |
121
- |--------|-----------|-------------|
122
- | `FLOW_STYLES` | flow, gap, columnGap, rowGap, align, justify, placeItems, placeContent, alignItems, alignContent, justifyItems, justifyContent, gridColumns, gridRows, gridTemplate, gridAreas | Layout containers (`Space`, `Grid`) |
123
- | `POSITION_STYLES` | gridArea, gridColumn, gridRow, order, placeSelf, alignSelf, justifySelf, zIndex, margin, inset, position | Positioned elements (`Button`, `Badge`) |
124
- | `DIMENSION_STYLES` | width, height, flexBasis, flexGrow, flexShrink, flex | Sized elements |
125
- | `COLOR_STYLES` | color, fill, fade, image | Color-customizable elements |
126
- | `BLOCK_STYLES` | padding, paddingInline, paddingBlock, overflow, scrollbar, textAlign, border, radius, shadow, outline | Block-level containers |
127
- | `CONTAINER_STYLES` | All of the above combined (+ BASE_STYLES) | Fully flexible containers |
128
- | `OUTER_STYLES` | POSITION_STYLES + DIMENSION_STYLES + block outer (border, radius, shadow, outline) | Components whose outer shell is customizable |
129
- | `INNER_STYLES` | BASE_STYLES + COLOR_STYLES + block inner (padding, overflow, scrollbar) + FLOW_STYLES | Components whose inner layout is customizable |
122
+ | Preset | Properties | Typical use |
123
+ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
124
+ | `FLOW_STYLES` | flow, gap, columnGap, rowGap, align, justify, place, placeItems, placeContent, alignItems, alignContent, justifyItems, justifyContent, gridColumns, gridRows, gridTemplate, gridAreas | Layout containers (`Space`, `Grid`) |
125
+ | `POSITION_STYLES` | gridArea, gridColumn, gridRow, order, placeSelf, alignSelf, justifySelf, zIndex, physical/logical margin, inset, scroll margin/padding, position | Positioned elements (`Button`, `Badge`) |
126
+ | `DIMENSION_STYLES` | width, height, blockSize, inlineSize, flexBasis, flexGrow, flexShrink, flex | Sized elements |
127
+ | `COLOR_STYLES` | color, fill, fade, image | Color-customizable elements |
128
+ | `BLOCK_STYLES` | padding, blockPadding, inlinePadding, overflow, scrollbar, textAlign, border, blockBorder, inlineBorder, radius, shadow, outline | Block-level containers |
129
+ | `TEXT_STYLES` | textTransform, fontWeight, fontStyle | Text elements |
130
+ | `CONTAINER_STYLES` | All of the above combined (+ BASE_STYLES) | Fully flexible containers |
131
+ | `OUTER_STYLES` | POSITION_STYLES + DIMENSION_STYLES + block outer (border, radius, shadow, outline) | Components whose outer shell is customizable |
132
+ | `INNER_STYLES` | BASE_STYLES + COLOR_STYLES + block inner (padding, overflow, scrollbar) + FLOW_STYLES | Components whose inner layout is customizable |
130
133
 
131
134
  ```tsx
132
135
  import { tasty, FLOW_STYLES, POSITION_STYLES } from '@tenphi/tasty';
@@ -154,12 +157,15 @@ Match the preset to the component's role:
154
157
 
155
158
  - **Layout containers** (`Space`, `Box`, `Grid`) — `FLOW_STYLES`, optionally with `DIMENSION_STYLES`
156
159
  - **Positioned elements** (`Button`, `Badge`) — `POSITION_STYLES`
157
- - **Text elements** — custom: `['preset', 'color']`
160
+ - **Text elements** — `['color', ...TEXT_STYLES]`
161
+
162
+ `BASE_STYLES` (`display`, `font`, `preset`, `hide`, `whiteSpace`, `opacity`, `transition`) are accepted as props on every component without being listed; extend that set app-wide with [`configure({ baseStyleProps })`](configuration.md#base-style-props).
163
+
158
164
  - **Compound components** — typically none; styling happens via sub-elements and extension
159
165
 
160
166
  ### The governance trade-off
161
167
 
162
- Exposing every CSS property as a prop defeats the purpose of a design system. The more props a component exposes, the more ways product engineers can deviate from the intended design. A good rule of thumb: expose props that product engineers *need* to adjust for layout and composition, and keep visual identity (colors, borders, typography) controlled through the component definition, variants, or styled wrappers.
168
+ Exposing every CSS property as a prop defeats the purpose of a design system. The more props a component exposes, the more ways product engineers can deviate from the intended design. A good rule of thumb: expose props that product engineers _need_ to adjust for layout and composition, and keep visual identity (colors, borders, typography) controlled through the component definition, variants, or styled wrappers.
163
169
 
164
170
  ---
165
171
 
@@ -180,17 +186,19 @@ const Card = tasty({
180
186
  });
181
187
 
182
188
  // Clean prop API — no mods object needed
183
- <Card isLoading isSelected>Content</Card>
189
+ <Card isLoading isSelected>
190
+ Content
191
+ </Card>;
184
192
  ```
185
193
 
186
194
  ### When to use which
187
195
 
188
- | Pattern | Use when |
189
- |---|---|
190
- | `modProps` | The component has a fixed set of known boolean/string states that drive styles. Provides TypeScript autocomplete and a cleaner JSX API. |
191
- | `mods` prop | The component needs arbitrary or dynamic modifiers that aren't known at definition time. |
192
- | Both | Combine `modProps` for the known states and `mods` for ad-hoc overrides. Mod props take precedence. |
193
- | `styleProps` | Exposing CSS properties (layout, sizing) for customization — different from modifiers. |
196
+ | Pattern | Use when |
197
+ | ------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
198
+ | `modProps` | The component has a fixed set of known boolean/string states that drive styles. Provides TypeScript autocomplete and a cleaner JSX API. |
199
+ | `mods` prop | The component needs arbitrary or dynamic modifiers that aren't known at definition time. |
200
+ | Both | Combine `modProps` for the known states and `mods` for ad-hoc overrides. Mod props take precedence. |
201
+ | `styleProps` | Exposing CSS properties (layout, sizing) for customization — different from modifiers. |
194
202
 
195
203
  ### Typed modProps vs array form
196
204
 
@@ -214,7 +222,27 @@ The array form is simpler but types all values as `ModValue`:
214
222
  modProps: ['isLoading', 'isSelected'] as const,
215
223
  ```
216
224
 
217
- For the full API reference, see [Runtime — Mod Props](runtime.md#mod-props).
225
+ For the full API reference, see [React API — Mod Props](react-api.md#mod-props).
226
+
227
+ ### variants vs modProps
228
+
229
+ Use `variants` for looks that replace each other (primary, danger, ghost) and `modProps` for states that combine (`isLoading`, `size`):
230
+
231
+ ```tsx
232
+ const Button = tasty({
233
+ as: 'button',
234
+ modProps: { isLoading: Boolean, size: ['sm', 'md', 'lg'] as const },
235
+ styles: { padding: { '': '1.5x 3x', 'size=sm': '1x 2x' }, radius: '1r' },
236
+ variants: {
237
+ default: { fill: '#primary', color: '#on-primary' },
238
+ danger: { fill: '#danger', color: '#on-danger' },
239
+ },
240
+ });
241
+
242
+ <Button variant="danger" size="sm" isLoading />;
243
+ ```
244
+
245
+ `variant` is typed from the variant keys, the `default` variant applies when no `variant` prop is passed (set the `variant` option, as in `variant: 'danger'`, to fall back to another one), and only variants that render emit CSS. See [React API — Variants](react-api.md#variants).
218
246
 
219
247
  ---
220
248
 
@@ -232,27 +260,27 @@ const ProgressBar = tasty({
232
260
  width: '$progress',
233
261
  height: '100%',
234
262
  fill: '#primary',
235
- transition: 'width 0.3s',
263
+ transition: 'width',
236
264
  },
237
265
  },
238
266
  elements: { Bar: 'div' },
239
267
  });
240
268
 
241
269
  // Usage: the progress value comes from a prop, not from styles
242
- <ProgressBar tokens={{ '$progress': `${percent}%` }} />
270
+ <ProgressBar tokens={{ $progress: `${percent}%` }} />;
243
271
  ```
244
272
 
245
273
  The `tokens` prop sets `style="--progress: 75%"` on the DOM element. The `$progress` reference in styles maps to `var(--progress)`, so the bar width updates without regenerating any CSS.
246
274
 
247
275
  ### When to use tokens vs other mechanisms
248
276
 
249
- | Need | Use |
250
- |------|-----|
251
- | Value changes per instance at render time (progress, user color, avatar size) | `tokens` prop (on component) |
252
- | Value is constant across all instances (card padding, border radius) | `configure({ tokens })` for `:root` CSS custom properties |
253
- | Value should be inlined at parse time (alias for another token) | `configure({ replaceTokens })` |
254
- | Value changes based on component state (hover, disabled, breakpoint) | State map in `styles` |
255
- | Value changes based on a variant (primary, danger, outline) | `variants` option |
277
+ | Need | Use |
278
+ | ----------------------------------------------------------------------------- | --------------------------------------------------------- |
279
+ | Value changes per instance at render time (progress, user color, avatar size) | `tokens` prop (on component) |
280
+ | Value is constant across all instances (card padding, border radius) | `configure({ tokens })` for `:root` CSS custom properties |
281
+ | Value should be inlined at parse time (alias for another token) | `configure({ replaceTokens })` |
282
+ | Value changes based on component state (hover, disabled, breakpoint) | State map in `styles` |
283
+ | Value changes based on a variant (primary, danger, outline) | `variants` option |
256
284
 
257
285
  Design tokens (via `configure({ tokens })`) are injected as CSS custom properties on `:root`. Replace tokens (via `configure({ replaceTokens })`) are resolved at parse time and baked into the generated CSS. The `tokens` prop on components is resolved at render time via inline CSS custom properties. Use design tokens for design-system constants, replace tokens for value aliases, and the `tokens` prop for truly dynamic per-instance values.
258
286
 
@@ -271,11 +299,11 @@ const ProgressBar = tasty({
271
299
  });
272
300
 
273
301
  // Clean prop API — no tokens object needed
274
- <ProgressBar progress="75%" accentColor="#purple" />
302
+ <ProgressBar progress="75%" accentColor="#purple" />;
275
303
 
276
304
  // Conversion:
277
305
  // 'progress' → $progress → --progress
278
- // 'accentColor' → #accent → --accent-color + --accent-color-oklch
306
+ // 'accentColor' → #accent → --accent-color
279
307
  ```
280
308
 
281
309
  #### Object form
@@ -291,7 +319,7 @@ const Card = tasty({
291
319
  styles: { padding: '$card-size', fill: '#card-accent' },
292
320
  });
293
321
 
294
- <Card size="4x" color="#purple" />
322
+ <Card size="4x" color="#purple" />;
295
323
  ```
296
324
 
297
325
  #### Merge order
@@ -326,15 +354,14 @@ const LargeCard = tasty(Card, {
326
354
  styles: { padding: '6x', Title: { color: '#danger' } },
327
355
  });
328
356
 
329
- <LargeCard />
357
+ <LargeCard />;
330
358
  ```
331
359
 
332
360
  Why? Styled wrappers are:
333
361
 
334
- - **Faster** — styles are parsed and injected once at definition time, not on every render
335
- - **Stable** — the style object is defined once, not recreated on every render
362
+ - **Stable** — the style object is defined once at module level, so Tasty merges and computes it once instead of on every render
336
363
  - **Composable** — another engineer can extend `LargeCard` further
337
- - **Inspectable** — the component has a name in React DevTools
364
+ - **Inspectable** — give it a `qa` (`tasty(Card, { qa: 'LargeCard', styles })`) and it appears as `data-qa="LargeCard"` in the DOM; React DevTools shows it as `TastyWrappedComponent(…)` around the base's name
338
365
  - **Lint-friendly** — the ESLint plugin's `no-styles-prop` rule flags direct usage
339
366
 
340
367
  The `styles` prop exists as an escape hatch — for prototyping, one-off overrides during development, or cases where wrapping is impractical. It should not be the default way product engineers customize components.
@@ -355,7 +382,7 @@ See [Best practices](#best-practices) below for the full list of do's and don'ts
355
382
 
356
383
  ## Wrapping and extension
357
384
 
358
- `tasty(Base, { styles })` is the primary extension mechanism. It creates a new component whose styles are merged with the base component's styles.
385
+ `tasty(Base, { styles })` is the primary extension mechanism. It creates a new component whose styles are merged with the base component's styles. The extension can also declare its own `styleProps`, `modProps`, `tokenProps`, `variants`, and `elements`, and it keeps the base's sub-elements — see [React API — Extend an existing component](react-api.md#extend-an-existing-component).
359
386
 
360
387
  ```tsx
361
388
  import { Button } from 'my-ds';
@@ -399,6 +426,34 @@ tasty(Button, {
399
426
 
400
427
  For full details on merge semantics, `@inherit`, `null`, and `false` tombstones, see [Style DSL — Extending vs. Replacing State Maps](dsl.md#extending-vs-replacing-state-maps).
401
428
 
429
+ ### Styling non-Tasty components or string tags
430
+
431
+ `tasty(Component, { ... })` always forwards every prop to `Component`, which means `Component` must be Tasty-aware (i.e. it knows how to consume `styles`, `mods`, `qa`, etc.). To apply styles to a third-party component (Next.js `Link`, `react-router`'s `Link`, Radix primitives, MUI, etc.) or to a plain DOM tag, use the options-only form with `as`:
432
+
433
+ ```tsx
434
+ import NextLink from 'next/link';
435
+
436
+ const Link = tasty({
437
+ as: NextLink,
438
+ styles: {
439
+ color: { '': '#accent-text', ':hover': '#text' },
440
+ textDecoration: 'underline',
441
+ },
442
+ styleProps: ['padding'],
443
+ });
444
+
445
+ const Span = tasty({
446
+ as: 'span',
447
+ styles: { preset: 'strong' },
448
+ });
449
+
450
+ <Link href="/blog" padding="1x">
451
+ Blog
452
+ </Link>;
453
+ ```
454
+
455
+ The wrapped component only needs to forward `className` (and ideally `style` and `ref`) to its underlying DOM node. Tasty-specific props (`qa`, `qaVal`, `mods`, `tokens`, `isDisabled`, `isHidden`, `isChecked`, and any `styleProps`/`modProps`/`tokenProps` you declared) are consumed by the wrapper and converted to `data-*` attributes or CSS custom properties — they never leak to the DOM.
456
+
402
457
  ### When to use styleProps vs wrapping
403
458
 
404
459
  If the component exposes the properties you need as `styleProps`, use them directly — that is what they are for:
@@ -421,11 +476,13 @@ const DangerCard = tasty(Card, {
421
476
 
422
477
  This is preferred over `<Card styles={{ border: '1bw solid #danger' }}>` because:
423
478
 
424
- 1. Styles are parsed and injected once, not on every render
479
+ 1. The styles live in one module-level definition instead of being rebuilt inside render
425
480
  2. `DangerCard` can be extended further by others
426
- 3. It has a meaningful name in DevTools and code search
481
+ 3. It is searchable in code, and carries `data-qa` in the DOM once you give it a `qa`
427
482
  4. The ESLint `no-styles-prop` rule encourages this pattern
428
483
 
484
+ A wrapper keeps the base's sub-element components, typed: `DangerCard.Title` is `Card.Title`, so `<DangerCard><DangerCard.Title>…</DangerCard.Title></DangerCard>` works. The wrapper's `Title` styles apply to it, because they target `[data-element="Title"]`.
485
+
429
486
  ---
430
487
 
431
488
  ## How configuration simplifies components
@@ -502,7 +559,7 @@ See [Configuration](configuration.md) for the full `configure()` API.
502
559
 
503
560
  - **Create styled wrappers** instead of passing `styles` directly — faster, composable, inspectable
504
561
  - **Use design tokens and custom units** (`#text`, `2x`, `1r`) instead of raw CSS values
505
- - **Use semantic transition names** (`transition: 'theme 0.3s'`) instead of listing CSS properties
562
+ - **Use semantic transition names** (`transition: 'theme'`) instead of listing CSS properties; omit the duration to use the motion tokens
506
563
  - **Use `elements` prop** to declare typed sub-components for compound components
507
564
  - **Use `styleProps`** to define what product engineers can customize
508
565
  - **Use `modProps`** to expose known modifier states as clean component props
@@ -522,7 +579,7 @@ fill: 'oklch(55% 0.25 265)',
522
579
  fill: '#primary',
523
580
  ```
524
581
 
525
- Tokens ensure consistency across components and make theme changes a one-line update.
582
+ Tokens ensure consistency across components and make theme changes a one-line update. The recommended lint config flags this with `tasty/no-raw-color-values` and `tasty/consistent-token-usage`.
526
583
 
527
584
  ### Using CSS property names when Tasty alternatives exist
528
585
 
@@ -538,7 +595,7 @@ radius: '1r',
538
595
  flow: 'column',
539
596
  ```
540
597
 
541
- Tasty's enhanced properties provide concise syntax, better composability, and simpler overrides. See [recommended props](styles.md#recommended-props) for the full mapping.
598
+ Tasty's enhanced properties provide concise syntax, better composability, and simpler overrides. See [recommended props](styles.md#recommended-props) for the full mapping. `tasty/prefer-shorthand-property` flags the native spellings.
542
599
 
543
600
  ### Changing styles prop at runtime
544
601
 
@@ -561,13 +618,13 @@ const Card = tasty({
561
618
  });
562
619
  ```
563
620
 
564
- Modifiers are compiled into exclusive selectors once. Changing `styles` at runtime forces Tasty to regenerate and re-inject CSS.
621
+ Modifiers are compiled into exclusive selectors once. A `styles` object that stays the same between renders (a module-level constant or a memoized object) is merged and computed once, but a new object on every render is merged and computed on every render, and each new value generates and injects new CSS. `tasty/no-styles-prop` and `tasty/no-runtime-styles-mutation` flag these patterns.
565
622
 
566
623
  ### Overusing style prop
567
624
 
568
625
  ```tsx
569
626
  // Bad: bypassing Tasty for custom styling
570
- <Button style={{ backgroundColor: 'red', padding: '12px 24px' }} />
627
+ <Button style={{ backgroundColor: 'red', padding: '12px 24px' }} />;
571
628
 
572
629
  // Good: create a styled wrapper
573
630
  const DangerButton = tasty(Button, {
@@ -575,7 +632,7 @@ const DangerButton = tasty(Button, {
575
632
  });
576
633
  ```
577
634
 
578
- The `style` prop bypasses tokens, units, and state maps. It should only be used for third-party library integration.
635
+ The `style` prop bypasses tokens, units, and state maps. It should only be used for third-party library integration. `tasty/no-style-prop` flags it on Tasty components.
579
636
 
580
637
  ### Skipping elements for compound components
581
638
 
@@ -584,7 +641,7 @@ The `style` prop bypasses tokens, units, and state maps. It should only be used
584
641
  <Card>
585
642
  <div data-element="Title">Card Title</div>
586
643
  <div data-element="Content">Card content</div>
587
- </Card>
644
+ </Card>;
588
645
 
589
646
  // Better: declare elements for typed sub-components
590
647
  const Card = tasty({
@@ -598,7 +655,7 @@ const Card = tasty({
598
655
  <Card>
599
656
  <Card.Title>Card Title</Card.Title>
600
657
  <Card.Content>Card content</Card.Content>
601
- </Card>
658
+ </Card>;
602
659
  ```
603
660
 
604
661
  The `elements` prop gives you typed sub-components with automatic `data-element` attributes, `mods` support, and better discoverability.
@@ -610,7 +667,7 @@ The `elements` prop gives you typed sub-components with automatic `data-element`
610
667
  - **[Getting Started](getting-started.md)** — Installation, first component, tooling setup
611
668
  - **[Building a Design System](design-system.md)** — Practical guide to building a DS layer with Tasty
612
669
  - **[Style DSL](dsl.md)** — State maps, tokens, units, extending semantics, keyframes, @property
613
- - **[Runtime API](runtime.md)** — `tasty()` factory, component props, variants, sub-elements, hooks
670
+ - **[React API](react-api.md)** — `tasty()` factory, component props, variants, sub-elements, style functions
614
671
  - **[Configuration](configuration.md)** — Full `configure()` API: tokens, recipes, custom units, style handlers
615
672
  - **[Style Properties](styles.md)** — Complete reference for all enhanced style properties
616
673
  - **[Adoption Guide](adoption.md)** — Who should adopt Tasty, incremental phases, what changes for product engineers
@@ -0,0 +1,285 @@
1
+ # Migration Guide: v2 → v3
2
+
3
+ Everything that changes when you upgrade from `@tenphi/tasty` 2.x to 3.0, in the order you will hit it.
4
+
5
+ Most of the work is mechanical renames — see the [search-and-replace cheat sheet](#search-and-replace-cheat-sheet) at the end. The parts that need real attention are the [directional shorthand](#2-directional-shorthand) rule and the [behavior changes](#8-behavior-changes-that-are-not-renames).
6
+
7
+ - [At a glance](#at-a-glance)
8
+ - [1. Styles-object keys](#1-styles-object-keys)
9
+ - [2. Directional shorthand](#2-directional-shorthand)
10
+ - [3. Config keys](#3-config-keys)
11
+ - [4. Renamed exports](#4-renamed-exports)
12
+ - [5. Removed exports](#5-removed-exports)
13
+ - [6. Removed props](#6-removed-props)
14
+ - [7. Moved subpath](#7-moved-subpath)
15
+ - [8. Behavior changes that are not renames](#8-behavior-changes-that-are-not-renames)
16
+ - [9. New in v3](#9-new-in-v3)
17
+ - [Search-and-replace cheat sheet](#search-and-replace-cheat-sheet)
18
+ - [Not changed](#not-changed)
19
+
20
+ ---
21
+
22
+ ## At a glance
23
+
24
+ | v2.11 | v3.0 | Find it with |
25
+ | ------------------------------- | --------------------------------- | ------------------------------ |
26
+ | `'@properties': { … }` | `'@property': { … }` | `rg "'@properties'"` |
27
+ | `'@fontFace': { … }` | `'@font-face': { … }` | `rg "'@fontFace'"` |
28
+ | `'@counterStyle': { … }` | `'@counter-style': { … }` | `rg "'@counterStyle'"` |
29
+ | `padding: '2x 4x top right'` | `padding: '2x top, 4x right'` | dev-mode console warning |
30
+ | `fade: '3x 1x top bottom'` | `fade: '3x top, 1x bottom'` | dev-mode console warning |
31
+ | `configure({ funcs })` | `configure({ functions })` | `rg "funcs"` |
32
+ | `configure({ fontFace })` | `configure({ fontFaces })` | `rg "fontFace:"` |
33
+ | `configure({ counterStyle })` | `configure({ counterStyles })` | `rg "counterStyle:"` |
34
+ | `getCssText()` | `getCSSText()` | `rg "getCssText"` |
35
+ | `getCssTextForNode()` | `getCSSTextForNode()` | `rg "getCssTextForNode"` |
36
+ | `getCssTextForClasses()` | `getCSSTextForClasses()` | `rg "getCssTextForClasses"` |
37
+ | `getGlobalFontFace()` | `getGlobalFontFaces()` | `rg "getGlobalFontFace\b"` |
38
+ | `getGlobalCounterStyle()` | `getGlobalCounterStyles()` | `rg "getGlobalCounterStyle\b"` |
39
+ | `getGlobalFunction()` | `getGlobalFunctions()` | `rg "getGlobalFunction\b"` |
40
+ | `okhslFunc` / `okhstFunc` | `okhslFunction` / `okhstFunction` | `rg "okhs[lt]Func\b"` |
41
+ | `CssOptions` | `CSSOptions` | `rg "CssOptions"` |
42
+ | `ParserOptions.funcs` | `ParserOptions.functions` | `rg "funcs:"` |
43
+ | `StyleParser#setFuncs()` | `StyleParser#setFunctions()` | `rg "setFuncs"` |
44
+ | `ChunkInfo` (from `tastyDebug`) | `DebugChunkInfo` | `rg "ChunkInfo"` |
45
+ | `@tenphi/tasty/next` | `@tenphi/tasty/zero/next` | `rg "tasty/next"` |
46
+ | `getIsTestEnvironment()` | `isTestEnvironment()` | `rg "getIsTestEnvironment"` |
47
+ | `hydrateTastyCache()` | `hydrateTastyClasses()` | `rg "hydrateTastyCache"` |
48
+
49
+ ---
50
+
51
+ ## 1. Styles-object keys
52
+
53
+ At-rule keys now match the real CSS at-rule names Tasty already emits, so they are kebab-case rather than camelCase. The generated CSS is unchanged.
54
+
55
+ ```diff
56
+ const Card = tasty({
57
+ styles: {
58
+ - '@properties': { '$elevation': { syntax: '<number>' } },
59
+ - '@fontFace': { Inter: { src: 'url(/inter.woff2)' } },
60
+ - '@counterStyle': { dashes: { system: 'cyclic', symbols: '"—"' } },
61
+ + '@property': { '$elevation': { syntax: '<number>' } },
62
+ + '@font-face': { Inter: { src: 'url(/inter.woff2)' } },
63
+ + '@counter-style': { dashes: { system: 'cyclic', symbols: '"—"' } },
64
+ },
65
+ });
66
+ ```
67
+
68
+ `@keyframes` and `@starting` are unchanged — they were already spec-faithful.
69
+
70
+ ---
71
+
72
+ ## 2. Directional shorthand
73
+
74
+ **This is the one change that can alter rendered CSS without a rename.** A style group that names direction modifiers now takes a **single** value, applied to every direction it names.
75
+
76
+ The old form looked positional but never was: the parser buckets values and modifiers into separate arrays per comma group, so `'2x 4x top right'`, `'2x top 4x right'`, and `'top 2x right 4x'` were all the same input, and the pairing was decided by the order the _modifiers_ happened to appear in. `'1x 2x right top'` and `'1x 2x top right'` produced different CSS, and `'1x 2x top top'` silently assigned `top` twice.
77
+
78
+ Per-side values now come from comma-separated groups:
79
+
80
+ ```diff
81
+ - padding: '2x 4x top right'
82
+ + padding: '2x top, 4x right'
83
+
84
+ - margin: 'right 1x top 2x'
85
+ + margin: '1x right, 2x top'
86
+
87
+ - inset: 'left 2x right 1x'
88
+ + inset: '2x left, 1x right'
89
+
90
+ - fade: '3x 1x top bottom'
91
+ + fade: '3x top, 1x bottom'
92
+ ```
93
+
94
+ Affects `padding`, `margin`, `inset`, `scrollMargin`, and `fade`. Extra values are ignored with a **development-mode warning** naming the offending value, so run your app in dev and watch the console — that is the reliable way to find every occurrence. Production is silent and never throws.
95
+
96
+ **Unchanged:** single-value directional groups (`padding: '2x top'`, `'1x left right'`), every value-only CSS shorthand form (`padding: '1x 2x'`, `'1x 2x 3x 4x'`, and `fade: '3x 1x'` — a group that names no direction is unambiguous and keeps plain shorthand order), CSS-wide keywords, and the `longhand` modifier.
97
+
98
+ `inset`'s `dock` modifier keeps its two-value form with sharper semantics: the first value applies to the named edge, the second to the perpendicular sides it spans, so `inset: '2x 4x bottom dock'` still gives `auto 32px 16px 32px`. A third value with `dock`, or a second value without it, now warns.
99
+
100
+ ---
101
+
102
+ ## 3. Config keys
103
+
104
+ ```diff
105
+ configure({
106
+ - funcs: { double: (groups) => `calc(2 * ${groups[0].output})` },
107
+ - fontFace: { Inter: { src: 'url(/inter.woff2)' } },
108
+ - counterStyle: { dashes: { system: 'cyclic', symbols: '"—"' } },
109
+ + functions: { double: (groups) => `calc(2 * ${groups[0].output})` },
110
+ + fontFaces: { Inter: { src: 'url(/inter.woff2)' } },
111
+ + counterStyles: { dashes: { system: 'cyclic', symbols: '"—"' } },
112
+ });
113
+ ```
114
+
115
+ `functions` is a single map holding both flavors, discriminated by value type:
116
+
117
+ - **bare key + function value** → a parse-time function, called as `name(...)`
118
+ - **`$$name` key + object value** → a declarative CSS `@function`, called as `$$name(...)`
119
+
120
+ A key whose prefix doesn't match its value type is ignored with a development warning.
121
+
122
+ > If you are coming from a pre-release build of v3, note the intermediate `function` config key never shipped. Upgraders from 2.x only ever wrote `funcs`.
123
+
124
+ ---
125
+
126
+ ## 4. Renamed exports
127
+
128
+ **Raw-CSS family** — aligned on the `CSS` initialism already used by `useRawCSS` / `injectRawCSS` / `getRawCSSText`:
129
+
130
+ - `getCssText()` → `getCSSText()`
131
+ - `getCssTextForNode()` → `getCSSTextForNode()`
132
+ - `StyleInjector#getCssTextForClasses()` → `getCSSTextForClasses()`
133
+ - `CssOptions` → `CSSOptions`
134
+
135
+ **Config getters** — pluralized to match their already-plural config keys:
136
+
137
+ - `getGlobalFontFace()` → `getGlobalFontFaces()`
138
+ - `getGlobalCounterStyle()` → `getGlobalCounterStyles()`
139
+ - `getGlobalFunction()` → `getGlobalFunctions()`
140
+
141
+ **Color functions** — aligned with the `useFunction` / `FunctionDefinition` family:
142
+
143
+ - `okhslFunc` → `okhslFunction`
144
+ - `okhstFunc` → `okhstFunction`
145
+ - `createColorFunc(name, channelLabel, convert)` → `createColorFunc(name, convert, label?)` — the label is now an optional trailing argument used only to format development warnings
146
+
147
+ **Parser** (`@tenphi/tasty/core`):
148
+
149
+ - `ParserOptions.funcs` → `ParserOptions.functions`
150
+ - `StyleParser#setFuncs()` → `StyleParser#setFunctions()`
151
+
152
+ **Debug types:** the debug-local `ChunkInfo` is now `DebugChunkInfo`, so it no longer collides with the parser's `ChunkInfo`.
153
+
154
+ ---
155
+
156
+ ## 5. Removed exports
157
+
158
+ | Removed | Use instead |
159
+ | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
160
+ | `getIsTestEnvironment()` | `isTestEnvironment()` |
161
+ | `hydrateTastyCache()` | `hydrateTastyClasses()` |
162
+ | `customFunc()` | `configure({ functions })` |
163
+ | `getGlobalFuncs()` | `getGlobalFunctions()` for `@function` definitions; the parse-function registry is internal |
164
+ | `resetGlobalFuncs()` | `resetConfig()` |
165
+ | `setGlobalPredefinedTokens()` | `configure({ replaceTokens })` |
166
+ | `resetGlobalPredefinedTokens()` | `resetConfig()` |
167
+ | `setMiddlewareTransferCache()` / `getMiddlewareTransferCache()` | internal; no replacement needed |
168
+ | `clearWriterCache()` | internal test utility |
169
+ | `DEFAULT_PLUGINS` | nothing — it was never consumed, and passing it to `configure({ plugins })` was a no-op. The default `okhsl`/`okhst` functions are registered automatically. |
170
+ | `registerDefaultFunctions()` | internal bootstrap helper |
171
+ | `warn()` / `deprecationWarning()` | internal helpers with no callers |
172
+ | `Bucket` enum | parser-internal |
173
+ | `Props` type | inline `Record<string, any>` |
174
+ | `UseStylesOptions` | `useStyles()` takes `Styles \| undefined` directly |
175
+ | `GlobalStyledProps` | its only member was the already-dead `breakpoints` prop |
176
+ | duplicate `PropertyOptions` | the single `PropertyOptions` from `injector/types` |
177
+
178
+ `getGlobalFuncs()` deserves a note: it returned the **live mutable internal registry**, and writing to it bypassed the parser's cache invalidation, so the write silently never took effect. If you were mutating it, move to `configure({ functions })`.
179
+
180
+ ---
181
+
182
+ ## 6. Removed props
183
+
184
+ `css`, `block`, `inline`, and `breakpoints` are gone from `BaseProps` / `TastySpecificKeys`. All four were typed but never consumed — passing them did nothing in v2 either.
185
+
186
+ ---
187
+
188
+ ## 7. Moved subpath
189
+
190
+ ```diff
191
+ - import { withTastyZero } from '@tenphi/tasty/next';
192
+ + import { withTastyZero } from '@tenphi/tasty/zero/next';
193
+ ```
194
+
195
+ The build-time extraction Next.js wrapper already lived under the `zero` namespace internally; the top-level `/next` path collided confusingly with `@tenphi/tasty/ssr/next`, which is a different integration.
196
+
197
+ ---
198
+
199
+ ## 8. Behavior changes that are not renames
200
+
201
+ **Repeated `configure()` calls now merge.** `recipes`, `keyframes`, `properties`, `fontFaces`, `counterStyles`, and CSS `@function` definitions used to replace wholesale, so a design-system `configure()` followed by an application `configure()` silently dropped the design system's values. All of them now merge, with the later call winning on a key conflict — matching `tokens` and `globalStyles`, which already merged. If you were relying on a second call to _clear_ a collection, use `resetConfig()`.
202
+
203
+ `configure({ polyfills })` is now correctly rejected after the first render, like every sibling option, and shallow-merges so an unrelated later call cannot switch a polyfill off.
204
+
205
+ **The `theme` prop is now implemented.** It maps to a `data-theme` attribute on the rendered element; previously it fell through and was spread onto the DOM raw. Augment `TastyThemeNames` for autocomplete.
206
+
207
+ **`tasty(Component, options)` no longer leaks factory-only options.** `variants`, `elements`, `styleProps`, `modProps`, and `tokenProps` are stripped instead of being passed to the wrapped component as runtime props, matching the element factory. Since 3.11 the extension form applies them as the element factory does; see [Extend an existing component](react-api.md#extend-an-existing-component).
208
+
209
+ **Replacing a built-in style handler now warns.** Built-in handlers are shared across style names, so `configure({ handlers: { fill } })` also takes over `image` and the whole `background-*` family, and `configure({ handlers: { display } })` takes down `flow`, `gap`, `hide`, `overflow`, `whiteSpace`, and `textOverflow`. This was always true; what's new is that a development-mode warning now names exactly what was displaced. If you see it, either declare the whole group and delegate the rest to `styleHandlers.*`, or pick a narrower name. See [Plugins](plugins.md#custom-style-handlers).
210
+
211
+ **Multi-dependency custom handlers are fixed.** A handler whose dependencies mixed known and unknown style names was invoked once per chunk with only _part_ of its dependencies, and could emit stale CSS. Unknown names now join their handler's chunk, so it is invoked once with all of them. No built-in style moved, so no existing class name changes.
212
+
213
+ **`isChecked` added to the root prop types.** It already worked at runtime; it was just missing from `BaseProps` / `AllBaseProps`.
214
+
215
+ **The `okhsl`/`okhst` "expected 3 values" warning is now development-only** and follows the `[Tasty]` prefix convention: `[Tasty] okhsl(): expected 3 values (H S L), got: …`. It previously fired in production.
216
+
217
+ ---
218
+
219
+ ## 9. New in v3
220
+
221
+ Nothing here is required to upgrade.
222
+
223
+ - **CSS `@function` support** — reusable, parameterized functions via the `'@function'` styles key, the `useFunction` style function, or `configure({ functions })`. Works across client rendering, SSR/RSC, and build-time extraction. `configure({ polyfills: { functions: true } })` inlines every call into plain CSS for browsers that don't ship the at-rule yet. See [Style DSL](dsl.md#functions-function).
224
+ - **Custom color plugins with no core special-casing** — `okhsl`/`okhst` are now ordinary one-line plugins, and a third-party color space can achieve identical integration. New `createColorFunc` and `resolveFunctionColor` helpers.
225
+ - **`configure({ propHandlers })`** — props middleware for every component: props in, props out. The extension point for props that aren't style values.
226
+ - **`configure({ baseStyleProps })`** — expose style properties as props on every component without listing them in each `styleProps`.
227
+ - **`defineHandler(deps, fn)`** — infers a multi-dependency handler's parameter types from its dependency list.
228
+ - **Plugins can supply `properties`, `keyframes`, `fontFaces`, and `counterStyles`** in addition to what they already could.
229
+ - See [Plugins & Extension Points](plugins.md) for all of the above.
230
+
231
+ ---
232
+
233
+ ## Search-and-replace cheat sheet
234
+
235
+ Run these in order — the `Css` → `CSS` renames must happen before any broader pattern, and the quoted at-rule keys must stay quote-anchored so they can't hit `configure({ properties })`.
236
+
237
+ ```bash
238
+ # 1. Raw-CSS family (before anything that touches "Css")
239
+ rg -l 'getCssTextForClasses' | xargs sed -i '' 's/getCssTextForClasses/getCSSTextForClasses/g'
240
+ rg -l 'getCssTextForNode' | xargs sed -i '' 's/getCssTextForNode/getCSSTextForNode/g'
241
+ rg -l 'getCssText' | xargs sed -i '' 's/getCssText/getCSSText/g'
242
+ rg -l 'CssOptions' | xargs sed -i '' 's/CssOptions/CSSOptions/g'
243
+
244
+ # 2. Styles-object at-rule keys (quote-anchored)
245
+ rg -l "'@properties'" | xargs sed -i '' "s/'@properties'/'@property'/g"
246
+ rg -l "'@fontFace'" | xargs sed -i '' "s/'@fontFace'/'@font-face'/g"
247
+ rg -l "'@counterStyle'" | xargs sed -i '' "s/'@counterStyle'/'@counter-style'/g"
248
+
249
+ # 3. Config getters (word-anchored so the plural forms are not double-pluralized)
250
+ rg -l 'getGlobalFontFace\b' | xargs sed -i '' 's/getGlobalFontFace\b/getGlobalFontFaces/g'
251
+ rg -l 'getGlobalCounterStyle\b' | xargs sed -i '' 's/getGlobalCounterStyle\b/getGlobalCounterStyles/g'
252
+ rg -l 'getGlobalFunction\b' | xargs sed -i '' 's/getGlobalFunction\b/getGlobalFunctions/g'
253
+
254
+ # 4. Color functions and parser methods
255
+ rg -l 'okhslFunc\b' | xargs sed -i '' 's/okhslFunc\b/okhslFunction/g'
256
+ rg -l 'okhstFunc\b' | xargs sed -i '' 's/okhstFunc\b/okhstFunction/g'
257
+ rg -l 'setFuncs' | xargs sed -i '' 's/setFuncs/setFunctions/g'
258
+
259
+ # 5. Removed exports with direct replacements
260
+ rg -l 'getIsTestEnvironment' | xargs sed -i '' 's/getIsTestEnvironment/isTestEnvironment/g'
261
+ rg -l 'hydrateTastyCache' | xargs sed -i '' 's/hydrateTastyCache/hydrateTastyClasses/g'
262
+
263
+ # 6. Moved subpath
264
+ rg -l "@tenphi/tasty/next" | xargs sed -i '' "s|@tenphi/tasty/next|@tenphi/tasty/zero/next|g"
265
+
266
+ # 7. Verify nothing is left (should print nothing)
267
+ rg "getCssText|CssOptions|'@properties'|'@fontFace'|'@counterStyle'|okhs[lt]Func\b|setFuncs|getIsTestEnvironment|hydrateTastyCache|@tenphi/tasty/next|getGlobalFontFace\b|getGlobalCounterStyle\b|getGlobalFunction\b"
268
+ ```
269
+
270
+ `configure({ funcs })` → `functions`, `fontFace` → `fontFaces`, and `counterStyle` → `counterStyles` are deliberately **not** scripted: those words appear in many other contexts, so change them by hand and let TypeScript find the call sites.
271
+
272
+ The directional shorthand cannot be scripted at all — the whole point is that the old form's meaning was not recoverable from its text. Run your app in development and follow the console warnings.
273
+
274
+ ---
275
+
276
+ ## Not changed
277
+
278
+ Worth stating explicitly, because it's easy to assume otherwise:
279
+
280
+ - **At-rule styles-object keys are CSS-spec-faithful, not JS-conventional.** `@keyframes`, `@property`, `@font-face`, `@counter-style`, `@function`, `@starting` — kebab-case, matching what Tasty emits.
281
+ - **The `func()` injector method stays abbreviated.** `function` is a reserved word.
282
+ - `injector.fontFace()` and `injector.counterStyle()` keep their singular names — only the _config keys_ and _getters_ were pluralized.
283
+ - `useFontFace` and `useCounterStyle` are unchanged.
284
+ - `configure({ properties })` and `autoPropertyTypes` are unchanged; only the styles-object `@property` key was renamed.
285
+ - **The deprecated style aliases are retained deliberately.** `backgroundColor`, `background`, `backgroundImage`, `flex`, `grid`, and `flexDirection` still carry `@deprecated` tags and still work. They are the guardrail that discourages their use in projects that have not enabled `@tenphi/eslint-plugin-tasty` yet — read the tags as guidance, not as a removal notice.