@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
  # Getting Started
2
2
 
3
- This guide walks you from zero to a working Tasty component, then through the optional shared configuration and tooling layers. It is the right starting point when you already want to try Tasty in code. If you are still deciding whether Tasty fits your team, start with [Comparison](comparison.md) and [Adoption Guide](adoption.md) first. For a feature overview, see the [README](../README.md). For the full style language reference, see the [Style DSL](dsl.md). For the React API, see the [Runtime API](runtime.md). For the rest of the docs by role or task, see the [Docs Hub](README.md).
3
+ Build one stateful component first. You will see how Tasty expresses priority as a state map, why overlapping states do not compete, and where shared design-system configuration fits afterward.
4
+
5
+ This is the right starting point when you are ready to try Tasty in code. If you are still evaluating it, read the [Introduction](../README.md), [Comparison](comparison.md), and [Adoption Guide](adoption.md).
4
6
 
5
7
  ---
6
8
 
@@ -10,7 +12,7 @@ This guide walks you from zero to a working Tasty component, then through the op
10
12
  - **React** >= 18 (peer dependency)
11
13
  - **Package manager**: pnpm, npm, or yarn
12
14
 
13
- Tasty can be used immediately in a React app, but it is most compelling for teams building reusable components with intersecting states, variants, tokens, and design-system conventions.
15
+ No Tasty configuration is required for the first component.
14
16
 
15
17
  ---
16
18
 
@@ -22,36 +24,57 @@ pnpm add @tenphi/tasty
22
24
 
23
25
  ---
24
26
 
25
- ## Your first component
27
+ ## Build a button whose states don’t fight
26
28
 
27
29
  ```tsx
28
30
  import { tasty } from '@tenphi/tasty';
29
31
 
30
- const Card = tasty({
31
- as: 'div',
32
+ const Button = tasty({
33
+ as: 'button',
32
34
  styles: {
33
- display: 'flex',
34
- flow: 'column',
35
- padding: '4x',
36
- gap: '2x',
37
- fill: '#white',
38
- border: true,
39
- radius: true,
35
+ padding: '12px 20px',
36
+ radius: '8px',
37
+ border: '0',
38
+ fill: {
39
+ '': 'royalblue',
40
+ ':hover': 'blue',
41
+ ':active': 'navy',
42
+ disabled: 'lightgray',
43
+ },
44
+ color: {
45
+ '': 'white',
46
+ disabled: 'dimgray',
47
+ },
48
+ cursor: {
49
+ '': 'pointer',
50
+ disabled: 'not-allowed',
51
+ },
40
52
  },
41
53
  });
42
54
 
43
55
  export default function App() {
44
- return <Card>Hello, Tasty!</Card>;
56
+ return (
57
+ <>
58
+ <Button>Save changes</Button>
59
+ <Button disabled>Disabled</Button>
60
+ </>
61
+ );
45
62
  }
46
63
  ```
47
64
 
48
- `tasty()` returns a normal React component. Values like `4x`, `#white`, `true`, and `1r` are Tasty DSL — they map to CSS custom properties, shorthand expansions, and design tokens. See [Style Properties](styles.md) for the full reference.
65
+ `tasty()` returns a normal React component. The keys in each state map define priority: later branches win over earlier ones. Because `disabled` is last, a disabled button keeps its disabled styles even while the pointer is over it.
66
+
67
+ `disabled`, `checked`, and `hidden` are built-in automatic states. Tasty sets `data-disabled`, `data-checked`, and `data-hidden` from the matching native prop, so `disabled` in a state map is the concise form of `[disabled]` (it compiles to `[data-disabled]`).
68
+
69
+ Tasty compiles that priority into selectors that exclude one another. The hover, active, and disabled background rules cannot all match and ask the CSS cascade to decide the winner.
70
+
71
+ The example uses ordinary CSS values so it works without setup. A design system will usually replace them with shared tokens, units, and state aliases in the next step. See the [Style DSL](dsl.md) for the complete state-map syntax and [Style Properties](styles.md) for Tasty’s enhanced CSS properties.
49
72
 
50
73
  ---
51
74
 
52
- ## Optional: add shared configuration
75
+ ## Add your design system’s language
53
76
 
54
- Use `configure()` once, before your app renders, when your app or design system needs shared state aliases, tokens, recipes, or parser extensions:
77
+ The first component needs no configuration. Use `configure()` once, before your app renders, when your app or design system is ready to share tokens, state aliases, recipes, units, or parser extensions:
55
78
 
56
79
  ```tsx
57
80
  // src/tasty-config.ts
@@ -78,9 +101,9 @@ import App from './App';
78
101
  createRoot(document.getElementById('root')!).render(<App />);
79
102
  ```
80
103
 
81
- ### Define shared tokens and override default unit values
104
+ ### Define shared tokens and units
82
105
 
83
- Color tokens like `#primary` resolve to CSS custom properties at runtime (e.g. `var(--primary-color)`). Built-in units like `x`, `r`, and `bw` already work without setup and multiply CSS custom properties by default. Use `configure({ tokens })` when you want to define shared token values or override the defaults your app uses:
106
+ Color tokens like `#primary` and value tokens like `$sidebar-width` resolve to CSS custom properties (`var(--primary-color)`, `var(--sidebar-width)`). Define their values with `configure({ tokens })`:
84
107
 
85
108
  ```tsx
86
109
  // src/tasty-config.ts
@@ -91,10 +114,7 @@ configure({
91
114
  '#primary': 'oklch(55% 0.25 265)',
92
115
  '#surface': '#fff',
93
116
  '#text': '#111',
94
- '$gap': '8px',
95
- '$radius': '4px',
96
- '$border-width': '1px',
97
- '$outline-width': '2px',
117
+ '$sidebar-width': '280px',
98
118
  },
99
119
  });
100
120
  ```
@@ -112,7 +132,20 @@ configure({
112
132
  });
113
133
  ```
114
134
 
115
- Every component using `#primary`, `2x`, or `1r` adjusts automatically. Tokens are injected as `:root` CSS custom properties when the first style is rendered. You can also use standard CSS color values such as `rgb(...)`, `hsl(...)`, and named colors directly; `okhsl(...)` is the recommended choice when you want authored colors that stay aligned with Tasty's design-system-oriented workflow.
135
+ Tokens are injected as `:root` CSS custom properties when the first style is rendered, and every component using `#primary` follows them. You can also use standard CSS color values such as `rgb(...)`, `hsl(...)`, and named colors directly; the built-in `okhsl(...)` and `okhst(...)` functions are the recommended choice when you want authored colors that stay aligned with Tasty's design-system-oriented workflow.
136
+
137
+ Units work differently: `x`, `r`, `cr`, `bw`, and `ow` compile to plain values when styles are generated (`2x` → `16px` with the default `8px` step), so setting a `$gap` token does not change them. Change the scale with `configure({ units })`:
138
+
139
+ ```tsx
140
+ configure({
141
+ units: {
142
+ x: '4px', // spacing step: 2x → 8px
143
+ r: '8px', // radius: 1r → 8px
144
+ },
145
+ });
146
+ ```
147
+
148
+ When the scale has to change at runtime, for example per theme or density, point the unit at a custom property and define that property as a token. With `units: { x: 'var(--gap)' }` and `tokens: { $gap: '8px' }`, `2x` compiles to `calc(2 * var(--gap))`. See [Built-in Units](dsl.md#built-in-units) for the defaults.
116
149
 
117
150
  > **Note:** `configure({ replaceTokens })` is a separate mechanism — it replaces tokens with literal values at parse time (baked into CSS). Use it for value aliases like `$card-padding: '4x'` that should be resolved during style generation, not for defining color or unit values. See [Configuration — Replace Tokens](configuration.md#replace-tokens-parse-time-substitution) for details.
118
151
 
@@ -122,7 +155,7 @@ See [Configuration](configuration.md) for the full `configure()` API — tokens,
122
155
 
123
156
  ## ESLint plugin
124
157
 
125
- The ESLint plugin catches invalid style properties, bad token references, malformed state keys, and other mistakes at lint time — before they reach the browser.
158
+ The ESLint plugin catches invalid style properties, bad token references, malformed state keys, and other mistakes at lint time — before they reach the browser. It checks style objects and JSX style props alike, and runs under both ESLint 9+ and oxlint.
126
159
 
127
160
  ### Install
128
161
 
@@ -144,54 +177,98 @@ export default [
144
177
  ];
145
178
  ```
146
179
 
147
- ### What `recommended` catches
180
+ ### Tell it about your design system
148
181
 
149
- The `recommended` config enables 18 of the plugin's 27 total rules. It covers the most common issues without turning on the stricter governance rules:
182
+ Without project configuration the plugin checks syntax and property names, but it cannot know which tokens, presets, or recipes exist. Add a `tasty.config.ts` at the project root to enable those checks for the names your `configure()` call defines:
150
183
 
151
- | Category | Rules | Examples |
152
- |----------|-------|---------|
153
- | Property validation | `known-property`, `valid-boolean-property`, `valid-sub-element` | Flags typos like `pading` or invalid boolean usage |
154
- | Value validation | `valid-value`, `valid-color-token`, `valid-custom-unit` | Catches `#nonexistent` tokens, bad unit syntax |
155
- | State validation | `valid-state-key`, `no-nested-state-map`, `require-default-state` | Validates state key syntax, ensures `''` default exists |
156
- | Structure | `valid-styles-structure`, `no-important`, `no-nested-selector` | Prevents `!important`, invalid nesting |
157
- | Static mode | `static-no-dynamic-values`, `static-valid-selector` | Enforces build-time constraints in `tastyStatic()` |
158
- | Style properties | `valid-preset`, `valid-recipe`, `valid-transition`, `valid-directional-modifier`, `valid-radius-shape` | Validates preset names, recipe references, transition syntax |
184
+ ```ts
185
+ // tasty.config.ts
186
+ export default {
187
+ tokens: ['#primary', '#surface', '#text', '$sidebar-width'],
188
+ states: ['@mobile', '@dark'],
189
+ presets: ['h1', 'h2', 't1', 't2'],
190
+ recipes: ['card'],
191
+ importSources: ['@my-org/ui'], // modules that re-export tasty()
192
+ };
193
+ ```
194
+
195
+ Every list is optional; leaving one out skips that check. `importSources` matters when your design system re-exports `tasty()` from its own module: the plugin only lints calls whose import it can trace.
196
+
197
+ ### What `recommended` catches
198
+
199
+ | Category | Rules | Examples |
200
+ | ------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
201
+ | Property validation | `known-property`, `valid-boolean-property`, `valid-sub-element` | Flags typos like `pading` or invalid boolean usage |
202
+ | Value validation | `valid-value`, `valid-color-token`, `valid-custom-unit` | Catches `#nonexistent` tokens, bad unit syntax |
203
+ | State validation | `valid-state-key`, `no-nested-state-map`, `require-default-state` | Validates state key syntax, ensures `''` default exists |
204
+ | Structure | `valid-styles-structure`, `no-important`, `no-nested-selector` | Prevents `!important`, invalid nesting |
205
+ | Static mode | `static-no-dynamic-values`, `static-valid-selector` | Enforces build-time constraints in `tastyStatic()` |
206
+ | Style properties | `valid-preset`, `valid-recipe`, `valid-transition`, `valid-directional-modifier`, `valid-radius-shape` | Validates preset names, recipe references, transition syntax |
207
+ | Token usage | `no-raw-color-values`, `consistent-token-usage`, `no-raw-transition-duration` | Suggests `#color` tokens over raw colors, units over raw pixel lengths |
208
+ | Preferred syntax | `prefer-shorthand-property`, `prefer-auto-calc`, `prefer-hide`, `prefer-state-negation`, and others | Suggests `fill` over `backgroundColor`, `(...)` over `calc(...)` |
209
+ | Component props | `no-style-prop`, `no-classname-prop`, `no-styles-prop` | Points escape hatches toward `tokens`, `mods`, and the component's props |
210
+ | Dynamic styles | `no-runtime-styles-mutation`, `no-style-spread` | Warns on JavaScript values and spreads inside runtime style objects |
159
211
 
160
212
  ### Strict config
161
213
 
162
- For stricter governance, use `tasty.configs.strict`. It adds rules that enforce best practices like preferring shorthand properties, consistent token usage, and flagging direct `styles` prop usage:
214
+ For stricter governance, use `tasty.configs.strict`. It adds existence checks for `$` custom properties and `@` state aliases, and validates state definitions in `configure()` and `tasty.config.ts`:
163
215
 
164
216
  ```js
165
- export default [
166
- tasty.configs.strict,
167
- ];
217
+ export default [tasty.configs.strict];
218
+ ```
219
+
220
+ See the [plugin README](https://github.com/tenphi/eslint-plugin-tasty) for every rule, the oxlint setup, and the experimental type-aware mode for JSX props.
221
+
222
+ ---
223
+
224
+ ## TypeScript autocomplete
225
+
226
+ Component props are typed from their definitions without extra setup: `modProps` value lists become unions, `variant` is typed from the variant keys, and sub-elements are typed components. To get autocomplete for your own token, preset, and theme names inside style values, register them with module augmentation:
227
+
228
+ ```ts
229
+ // tasty.d.ts
230
+ import '@tenphi/tasty';
231
+
232
+ declare module '@tenphi/tasty' {
233
+ interface TastyNamedColors {
234
+ primary: true;
235
+ surface: true;
236
+ text: true;
237
+ }
238
+ interface TastyPresetNames {
239
+ h1: true;
240
+ t2: true;
241
+ }
242
+ }
168
243
  ```
169
244
 
245
+ See [Configuration → TypeScript](configuration.md#typescript) for every augmentation interface and how component props are typed.
246
+
170
247
  ---
171
248
 
172
249
  ## Editor support
173
250
 
174
- **[VS Code Extension](https://github.com/tenphi/tasty-vscode-extension)** — Syntax highlighting for Tasty styles in TypeScript/TSX/JavaScript/JSX. Highlights color tokens, custom units, state keys, presets, and style properties inside `tasty()` and `tastyStatic()` calls. Install from the VS Code marketplace or from a `.vsix` file.
251
+ **[VS Code Extension](https://github.com/tenphi/tasty-vscode-extension)** — Syntax highlighting for Tasty styles in TypeScript/TSX/JavaScript/JSX: color tokens, custom units, state keys, presets, and style properties inside `tasty()`, `tastyStatic()`, `styles` objects, and style functions. It also adds snippets for components, state maps, and `configure()`. Install the `.vsix` from the [latest GitHub release](https://github.com/tenphi/tasty-vscode-extension/releases/latest); the extension is not published to the marketplace.
175
252
 
176
- **[Glaze](https://github.com/tenphi/glaze)** — OKHSL-based color theme generator with automatic WCAG contrast solving. Generate light, dark, and high-contrast color palettes from a single hue and export them directly as Tasty color tokens. See the [Ecosystem section](../README.md#ecosystem) in the README.
253
+ **[Glaze](https://github.com/tenphi/glaze)** — Not an editor tool, but the fastest way to fill `configure({ tokens })`: it generates light, dark, and high-contrast palettes from one hue in the OKHST color space, solves WCAG and APCA contrast, and exports them as Tasty tokens with `configure({ tokens: theme.tasty() })`. See [Glaze in the README](../README.md#glaze).
177
254
 
178
255
  ---
179
256
 
180
257
  ## Choosing a rendering mode
181
258
 
182
- Tasty has two styling approaches. Pick the one that fits your use case, then decide whether your runtime setup also needs server rendering support:
259
+ `tasty()` is the default for all React apps. All `tasty()` components and style functions are hook-free and work as React Server Components without `'use client'`. Zero-runtime delivery is not tied to one API: both server-only `tasty()` and build-time `tastyStatic()` can ship no Tasty styling runtime to the browser.
183
260
 
184
- | Approach | Entry point | Best for | Trade-off |
185
- |------|-------------|----------|-----------|
186
- | **Runtime** | `tasty()` from `@tenphi/tasty` | Interactive apps with reusable stateful components, design systems | CSS generated at runtime; full feature set (styleProps, sub-elements, variants) |
187
- | **Zero-runtime** | `tastyStatic()` from `@tenphi/tasty/static` | Static sites, landing pages, SSG | Zero JS overhead; requires Babel plugin; no dynamic props |
261
+ | Approach | Authoring API | CSS is generated | Tasty runtime in the browser | Best for |
262
+ | ------------------------- | ------------------------------------------- | ----------------------------------- | ---------------------------- | ---------------------------------------------------------------- |
263
+ | **Server-only React** | `tasty()`; optional `@tenphi/tasty/ssr/*` | During server or static rendering | None | Astro without islands, server-only RSC, SSG |
264
+ | **Hydrated React** | `tasty()` plus `@tenphi/tasty/ssr/*` | During SSR, then on demand in React | Only in hydrated components | Interactive React apps, Next.js client components, Astro islands |
265
+ | **Build-time extraction** | `tastyStatic()` from `@tenphi/tasty/static` | During the build | None in file mode | Non-React frameworks or extraction before rendering |
188
266
 
189
- Both share the same DSL, tokens, units, and state mappings.
267
+ Both `tasty()` and `tastyStatic()` share the same DSL, tokens, units, and state mappings.
190
268
 
191
- - Runtime is the default and requires no extra setup beyond `@tenphi/tasty`.
192
- - If your framework can execute runtime code during server rendering, add SSR support on top of runtime with `@tenphi/tasty/ssr/next`, `@tenphi/tasty/ssr/astro`, or the core SSR API. This still uses `tasty()`; it just collects CSS on the server and hydrates the cache on the client.
193
- - Zero-runtime requires the Babel plugin and additional peer dependencies. See [Zero Runtime (tastyStatic)](tasty-static.md).
194
- - SSR works with existing `tasty()` components — wrap your app with a registry, middleware, or collector. See [Server-Side Rendering](ssr.md).
269
+ - **Server-only `tasty()`** keeps the full feature set (`styleProps`, sub-elements, variants) while generating CSS during server rendering. `tasty()` plus `tastyIntegration({ islands: false })` in Astro is the verified concrete setup and ships no client JavaScript. The same server-only architecture applies to Next.js RSC; verify the generated output for your deployment.
270
+ - **Hydrated `tasty()`** uses the SSR integrations to batch and deduplicate server CSS, prevent FOUC, and hydrate the client cache. The browser styling pipeline is available only where React components hydrate. See [Server-Side Rendering](ssr.md).
271
+ - **Build-time extraction** uses the Babel plugin and additional peer dependencies. Choose `tastyStatic()` when CSS must be generated before rendering or when the consumer is not React. File mode ships no styling runtime; inject mode intentionally includes a tiny CSS injector. See [Build-Time Extraction (`tastyStatic`)](tasty-static.md).
195
272
 
196
273
  ---
197
274
 
@@ -200,11 +277,12 @@ Both share the same DSL, tokens, units, and state mappings.
200
277
  - **[Docs Hub](README.md)** — Pick the next guide by role, styling approach, or task
201
278
  - **[Methodology](methodology.md)** — The recommended patterns for structuring Tasty components: sub-elements, styleProps, tokens, extension
202
279
  - **[Style DSL](dsl.md)** — State maps, tokens, units, extending semantics, keyframes, @property
203
- - **[Runtime API](runtime.md)** — `tasty()` factory, component props, variants, sub-elements, hooks
280
+ - **[React API](react-api.md)** — `tasty()` factory, component props, variants, sub-elements, style functions
204
281
  - **[Building a Design System](design-system.md)** — Practical guide to building a DS layer with Tasty: tokens, recipes, primitives, compound components
205
282
  - **[Adoption Guide](adoption.md)** — Roll out Tasty inside an existing design system or platform team
206
283
  - **[Comparison](comparison.md)** — Evaluate Tasty against other styling systems
207
284
  - **[Configuration](configuration.md)** — Full `configure()` API: tokens, recipes, custom units, style handlers, TypeScript extensions
285
+ - **[Plugins & Extension Points](plugins.md)** — Add your own style properties, units, functions, and component props
208
286
  - **[Style Properties](styles.md)** — Complete reference for all enhanced style properties
209
287
  - **[Debug Utilities](debug.md)** — Inspect generated CSS and debug runtime behavior when styles do not look right
210
288
 
@@ -214,4 +292,6 @@ Both share the same DSL, tokens, units, and state mappings.
214
292
 
215
293
  - Styles are missing on first render: make sure the file that calls `configure()` is imported before any `tasty()` component renders.
216
294
  - Token or unit values are not what you expect: check your `configure({ tokens, units })` setup, then inspect the generated CSS variables with [Debug Utilities](debug.md).
217
- - You need build-time extraction or server-rendered CSS delivery: use [Zero Runtime (tastyStatic)](tasty-static.md) for extraction, or add [Server-Side Rendering](ssr.md) on top of runtime `tasty()` when your framework renders on the server.
295
+ - Changing a `$gap` or `$radius` token does not change `2x` or `1r`: units compile to plain values from `configure({ units })`. Point a unit at the custom property (`units: { x: 'var(--gap)' }`) if it should follow the token.
296
+ - The linter accepts unknown tokens or presets: list them in `tasty.config.ts` so the plugin knows what your design system defines.
297
+ - You need zero-runtime delivery: use server-only [`tasty()` with server rendering](ssr.md) to keep the full React API, or use [`tastyStatic()` build-time extraction](tasty-static.md) when styles must be compiled before rendering.