@tenphi/tasty 0.0.0-snapshot.1f1c00a → 0.0.0-snapshot.1feecc6

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 (94) hide show
  1. package/README.md +403 -380
  2. package/dist/babel-types-Dc5zghyE.d.ts +18 -0
  3. package/dist/chunks/async-storage-f9j9JRtq.js +37 -0
  4. package/dist/chunks/async-storage-f9j9JRtq.js.map +1 -0
  5. package/dist/chunks/build-config-D9Iq8QQm.js +60 -0
  6. package/dist/chunks/build-config-D9Iq8QQm.js.map +1 -0
  7. package/dist/chunks/{collector-D2ARGT2L.js → collector-Cb8ah2JF.js} +8 -6
  8. package/dist/chunks/collector-Cb8ah2JF.js.map +1 -0
  9. package/dist/chunks/{config-engine-DEmmPPdp.js → config-engine-CMYFZYQh.js} +5 -5
  10. package/dist/chunks/config-engine-CMYFZYQh.js.map +1 -0
  11. package/dist/chunks/config-file-DlZXJMj8.js +25 -0
  12. package/dist/chunks/config-file-DlZXJMj8.js.map +1 -0
  13. package/dist/chunks/{css-definitions-DotDkIXt.js → css-definitions-B4aWBkH3.js} +130 -96
  14. package/dist/chunks/css-definitions-B4aWBkH3.js.map +1 -0
  15. package/dist/chunks/{debug-D8pg9RGI.js → debug-D2Pu7Xhy.js} +6 -6
  16. package/dist/chunks/{debug-D8pg9RGI.js.map → debug-D2Pu7Xhy.js.map} +1 -1
  17. package/dist/chunks/{dsl-DRhFWQzo.js → dsl-CsFl9LGn.js} +132 -52
  18. package/dist/chunks/dsl-CsFl9LGn.js.map +1 -0
  19. package/dist/chunks/{react-runtime-BpxlOTbO.js → react-runtime-DHiopXCu.js} +193 -64
  20. package/dist/chunks/react-runtime-DHiopXCu.js.map +1 -0
  21. package/dist/chunks/{runtime-engine-CKFXUH-A.js → runtime-engine-NGCofNXy.js} +72 -53
  22. package/dist/chunks/runtime-engine-NGCofNXy.js.map +1 -0
  23. package/dist/chunks/{runtime-state-BxaLhVdP.js → runtime-state-lZjMbvwV.js} +28 -3
  24. package/dist/chunks/runtime-state-lZjMbvwV.js.map +1 -0
  25. package/dist/chunks/{style-engine-BBbBuSkT.js → style-engine-DnkV_4Jg.js} +488 -146
  26. package/dist/chunks/style-engine-DnkV_4Jg.js.map +1 -0
  27. package/dist/chunks/{zero-engine-gJrKBRiw.js → zero-engine-DcwaCvFs.js} +62 -27
  28. package/dist/chunks/zero-engine-DcwaCvFs.js.map +1 -0
  29. package/dist/{collector-w4mBj5gd.d.ts → collector-D2OT6I2G.d.ts} +2 -2
  30. package/dist/{config-CZWCzBr6.d.ts → config-C4ftFxgI.d.ts} +41 -23
  31. package/dist/core/index.d.ts +4 -4
  32. package/dist/core/index.js +7 -7
  33. package/dist/hydrate-CRyjjAyl.d.ts +22 -0
  34. package/dist/{index-G9JuwM9p.d.ts → index-DxQNRj50.d.ts} +65 -21
  35. package/dist/index.d.ts +5 -5
  36. package/dist/index.js +8 -8
  37. package/dist/{merge-styles-VXwJ0Frr.d.ts → merge-styles-D39qBtox.d.ts} +2 -2
  38. package/dist/ssr/astro.js +4 -4
  39. package/dist/ssr/client.d.ts +2 -0
  40. package/dist/ssr/client.js +2 -0
  41. package/dist/ssr/index.d.ts +3 -22
  42. package/dist/ssr/index.js +4 -4
  43. package/dist/ssr/index.js.map +1 -1
  44. package/dist/ssr/next-config.d.ts +1 -1
  45. package/dist/ssr/next-config.js +13 -18
  46. package/dist/ssr/next-config.js.map +1 -1
  47. package/dist/ssr/next.d.ts +1 -1
  48. package/dist/ssr/next.js +3 -3
  49. package/dist/static/index.d.ts +2 -2
  50. package/dist/{types-JEY8PVYP.d.ts → types-CYQIhUg1.d.ts} +10 -8
  51. package/dist/zero/babel.d.ts +73 -2
  52. package/dist/zero/babel.js +51 -48
  53. package/dist/zero/babel.js.map +1 -1
  54. package/dist/zero/index.d.ts +59 -3
  55. package/dist/zero/index.js +25 -2
  56. package/dist/zero/index.js.map +1 -0
  57. package/dist/zero/next.d.ts +2 -1
  58. package/dist/zero/next.js +3 -7
  59. package/dist/zero/next.js.map +1 -1
  60. package/docs/README.md +4 -1
  61. package/docs/adoption.md +25 -17
  62. package/docs/ai-agents.md +43 -34
  63. package/docs/comparison.md +9 -8
  64. package/docs/configuration.md +187 -69
  65. package/docs/debug.md +3 -2
  66. package/docs/design-system.md +117 -15
  67. package/docs/dsl.md +262 -116
  68. package/docs/getting-started.md +81 -24
  69. package/docs/injector.md +41 -40
  70. package/docs/methodology.md +46 -21
  71. package/docs/migration-v3.md +3 -3
  72. package/docs/pipeline.md +22 -19
  73. package/docs/plugins.md +21 -41
  74. package/docs/react-api.md +74 -11
  75. package/docs/runtime-benchmarks.md +11 -11
  76. package/docs/ssr.md +92 -66
  77. package/docs/styles.md +85 -19
  78. package/docs/tasty-static.md +175 -57
  79. package/package.json +45 -32
  80. package/tasty.config.ts +1 -0
  81. package/dist/babel-rZcEwPLM.d.ts +0 -82
  82. package/dist/chunks/async-storage-CG5HnUT5.js +0 -20
  83. package/dist/chunks/async-storage-CG5HnUT5.js.map +0 -1
  84. package/dist/chunks/build-config-CL4eRu2z.js +0 -42
  85. package/dist/chunks/build-config-CL4eRu2z.js.map +0 -1
  86. package/dist/chunks/collector-D2ARGT2L.js.map +0 -1
  87. package/dist/chunks/config-engine-DEmmPPdp.js.map +0 -1
  88. package/dist/chunks/css-definitions-DotDkIXt.js.map +0 -1
  89. package/dist/chunks/dsl-DRhFWQzo.js.map +0 -1
  90. package/dist/chunks/react-runtime-BpxlOTbO.js.map +0 -1
  91. package/dist/chunks/runtime-engine-CKFXUH-A.js.map +0 -1
  92. package/dist/chunks/runtime-state-BxaLhVdP.js.map +0 -1
  93. package/dist/chunks/style-engine-BBbBuSkT.js.map +0 -1
  94. package/dist/chunks/zero-engine-gJrKBRiw.js.map +0 -1
package/docs/ai-agents.md CHANGED
@@ -10,6 +10,8 @@ Notation: ❌ wrong → ✅ correct.
10
10
 
11
11
  Color tokens (`#name`), custom properties (`$name`), `preset` names, `recipe` names, state aliases (`@mobile`) and extra units are **project-defined** in `tasty.config.ts` or a `configure({ … })` call. Look them up before writing styles. Never invent a name — reuse an existing one, or add it to the config.
12
12
 
13
+ Only Tasty's built-ins exist without config: `#white`, `#black`, `#border`, `#outline`, `#current`, `#clear`, and `$gap`, `$radius`, `$border-width`, `$outline-width`, `$transition`, `$sharp-radius`, `$bold-font-weight`, `$icon-size` (only where a `preset` applies), `$font-sans-fallback`, `$font-mono-fallback`.
14
+
13
15
  ## 1. Where styles go
14
16
 
15
17
  ```jsx
@@ -64,19 +66,22 @@ The last row goes the other way — longhands over the shorthand — because `fl
64
66
 
65
67
  ### Tokens
66
68
 
67
- | Syntax | Meaning |
68
- | --------------------- | ------------------------------------------------------------------------- |
69
- | `#name` | color token → `var(--name-color)` |
70
- | `#name.50` | token at 50% opacity (`0`–`100`) |
71
- | `#name.$opacity` | opacity from a custom property |
72
- | `#clear` / `#current` | `transparent` / `currentcolor` |
73
- | `$name` | custom property → `var(--name)` |
74
- | `(#a, #b)` | fallback chain |
75
- | `$$name` / `##name` | the custom property _name_ (not its value) — inside `transition` |
76
- | `$$name(…)` | call a CSS `@function` declared via `@function`, `useFunction`, or config |
77
-
78
- - ❌ `#f5f5f5`, `rgb(0 0 0)`, `oklch(…)`, `okhsl(…)`, `red` → ✅ `#surface` (add the token to the config if it doesn't exist).
69
+ | Syntax | Meaning |
70
+ | --------------------- | -------------------------------------------------------------------------------------------------- |
71
+ | `#name` | color token → `var(--name-color)` |
72
+ | `#name.50` | token at 50% opacity — digits are a decimal fraction: `.5` = `.50` = 50%, `.05` = 5%, `.100` = 10% |
73
+ | `#name.$opacity` | opacity from a custom property |
74
+ | `#clear` / `#current` | `transparent` / `currentcolor` |
75
+ | `#a+#b.04` | `#b` at 4% opacity over `#a`, as one color; layers stack left to right (`#a+#b.1+#c.04`) |
76
+ | `$name` | custom property → `var(--name)` |
77
+ | `(#a, #b)` | fallback chain |
78
+ | `$$name` / `##name` | the custom property _name_ (not its value) — inside `transition` |
79
+ | `$$name(…)` | call a CSS `@function` declared via `@function`, `useFunction`, or config |
80
+
81
+ - ❌ `#f5f5f5`, `rgb(0 0 0)`, `oklch(…)`, `okhsl(…)`, `okhst(…)`, `red` → ✅ `#surface` (add the token to the config if it doesn't exist).
82
+ - CSS system colors (`Canvas`, `CanvasText`, `Highlight`, `ButtonText`, `GrayText`, …) are the exception, for `forced-colors` styles: hold one in a token (`'#forced-border': 'CanvasText'`) or write it under a `@media(forced-colors: active)` state.
79
83
  - ❌ `var(--gap)` → ✅ `$gap` · ❌ `$accent-color` → ✅ `#accent` · ❌ `transparent` → ✅ `#clear` · ❌ `currentColor` → ✅ `#current`.
84
+ - `#clear` is a default replace token for `transparent`, so `#clear.5` and `#clear.$opacity` stay transparent. It does not read `--clear-color`; override it through `replaceTokens` if needed.
80
85
  - A `$name` must be declared as a `'$name': value` key in the same styles object, or in the config.
81
86
  - Names are case-sensitive and start lowercase — `$myVar` → `--myVar`; a leading capital folds (`$Foo` → `--foo`). Prefer kebab-case.
82
87
  - A `$name` reference is untyped: it fills the first free slot in a shorthand (`border: '1bw $my-style'` → the line style). Write colors as `#name`; `$name-color` is a fallback for pointing at a raw CSS custom property that holds a color.
@@ -84,7 +89,7 @@ The last row goes the other way — longhands over the shorthand — because `fl
84
89
 
85
90
  ### Units
86
91
 
87
- Tasty units: `x` (gap multiple), `r` (radius), `cr` (card radius), `bw` (border width), `ow` (outline width), `sf` (`minmax(0, Nfr)`). All CSS units work too, plus anything in `units` in the config. Any other unit is an error.
92
+ Tasty units and their defaults: `x` 8px spacing step, `r` 6px radius, `cr` 10px card radius, `bw` 1px border width, `ow` 3px outline width, `sf` → `minmax(0, Nfr)`. They compile to literal values; change them through `units` in the config, not with `$gap`/`$radius` tokens. All CSS units work too, plus anything in `units` in the config. Any other unit is an error. Inside `@media(…)` / `@(…)` conditions units resolve to their literal length (`@media(w < 40x)` → `width < 320px`), unless the project points that unit at a custom property; then write query lengths in `px`, `em`, or `rem`.
88
93
 
89
94
  Prefer units over raw pixels: `8px` → `1x` … `64px` → `8x`; `radius: '6px'` → `'1r'`; `border: '1px …'` → `'1bw …'`.
90
95
 
@@ -94,7 +99,7 @@ Prefer units over raw pixels: `8px` → `1x` … `64px` → `8x`; `radius: '6px'
94
99
 
95
100
  ### `true`
96
101
 
97
- `true` means "the design-system default" and is accepted **only** by: `border`, `radius`, `outline`, `shadow`, `padding`, `margin`, `gap`, `inset`, `width`, `height`, `fill`, `color`, `fade`, `preset`, `font`, `scrollbar`, `scrollMargin`, `scrollPadding`, and the enhanced logical category styles listed above, plus `hide`. Anywhere else it is an error.
102
+ `true` means "the design-system default" and is accepted **only** by: `border`, `radius`, `outline`, `shadow`, `padding`, `margin`, `gap`, `inset`, `width`, `height`, `color`, `fade`, `preset`, `font`, `scrollbar`, `scrollMargin`, `scrollPadding`, and the enhanced logical category styles listed above, plus `hide`. Anywhere else it is an error.
98
103
 
99
104
  ### `!important`
100
105
 
@@ -104,21 +109,23 @@ Never use it. Tasty owns specificity through doubled selectors and state orderin
104
109
 
105
110
  A value is `[values…] [modifiers…]`, and several groups can be comma-separated (later groups override earlier ones). A group that names **direction** modifiers takes a **single** value, applied to every direction it names — per-side values come from comma groups. A group naming no direction keeps plain CSS shorthand order (1–4 values). (`inset` + `dock` is the one exception: a second value insets the spanned sides.) Only the modifiers a property knows are valid:
106
111
 
107
- | Property | Modifiers |
108
- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
109
- | `padding`, `margin`, `inset`, `fade` | `top` `right` `bottom` `left` |
110
- | `border` | the four directions + `solid` `dashed` `dotted` `double` `groove` `ridge` `inset` `outset` `none` `hidden` |
111
- | logical axis spacing/inset styles | `start` `end` |
112
- | `blockBorder`, `inlineBorder` | `start` `end` + the border style keywords above |
113
- | `outline` | the style keywords above |
114
- | `radius` | `top` `right` `bottom` `left` + shapes `round` `ellipse` `leaf` `backleaf` |
115
- | `width`, `height`, `blockSize`, `inlineSize` | `min` `max` `fixed` |
116
- | `flow` | `row` `column` `row-reverse` `column-reverse` `wrap` `nowrap` `dense` |
117
- | `overflow` | `visible` `hidden` `scroll` `clip` `auto` `overlay` |
118
- | `position` | `static` `relative` `absolute` `fixed` `sticky` |
119
- | `shadow` | `inset` |
120
- | `preset` | `name / strong` (or `bold`) `italic` `icon` `tight` |
121
- | box properties | `longhand` — emit CSS longhands instead of the shorthand |
112
+ | Property | Modifiers |
113
+ | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
114
+ | `padding`, `margin`, `fade` | `top` `right` `bottom` `left` |
115
+ | `inset` | the four directions + `dock` |
116
+ | `border` | the four directions + `solid` `dashed` `dotted` `double` `groove` `ridge` `inset` `outset` `none` `hidden` |
117
+ | logical axis spacing/inset styles | `start` `end` |
118
+ | `blockBorder`, `inlineBorder` | `start` `end` + the border style keywords above |
119
+ | `outline` | the style keywords above |
120
+ | `radius` | `top` `right` `bottom` `left`, corners `top-left` `top-right` `bottom-right` `bottom-left`, `inherit` + shapes `round` `ellipse` `leaf` `backleaf` |
121
+ | `width`, `height`, `blockSize`, `inlineSize` | `min` `max` `fixed` |
122
+ | `flow` | `row` `column` `row-reverse` `column-reverse` `wrap` `nowrap` `dense` |
123
+ | `overflow` | `visible` `hidden` `scroll` `clip` `auto` `overlay` |
124
+ | `position` | `static` `relative` `absolute` `fixed` `sticky` |
125
+ | `shadow` | `inset` |
126
+ | `preset` | `name / strong` (or `bold`) `italic` `icon` `tight` `normal` |
127
+ | `scrollbar` | `thin` `auto` `none` `stable` `both-edges` `always` |
128
+ | box properties | `longhand` — emit CSS longhands instead of the shorthand |
122
129
 
123
130
  Directional modifiers beat placeholder zeros:
124
131
 
@@ -128,11 +135,11 @@ Directional modifiers beat placeholder zeros:
128
135
  - ❌ `padding: '2x 4x top right'` — a directional group takes one value, so `4x` is dropped → ✅ `padding: '2x top, 4x right'`
129
136
  - ❌ `fade: '3x 1x top bottom'` → ✅ `fade: '3x top, 1x bottom'`
130
137
 
131
- Value-only properties reject both colors and modifiers: `gap`, `columnGap`, `rowGap`, `opacity`, `zIndex`, `order`, `flexGrow`, `flexShrink`, `flexBasis`, `aspectRatio`, `lineClamp`, and `tabSize`. Logical axis category styles accept one or two values in start/end order and the `start`, `end`, and `longhand` modifiers. `fill` and `color` take a color (plus `none` / `transparent`); `caretColor` and `accentColor` take a color only.
138
+ Value-only properties reject both colors and modifiers: `gap`, `columnGap`, `rowGap`, `opacity`, `zIndex`, `order`, `flexGrow`, `flexShrink`, `flexBasis`, `aspectRatio`, `lineClamp`, and `tabSize`. Logical axis category styles accept one or two values in start/end order and the `start`, `end`, and `longhand` modifiers. `fill`, `color`, `caretColor`, and `accentColor` take a color only (use `#clear` for transparent). An overlay is a compound color, in any color slot: ❌ `fill: '#surface #dark.04'` (deprecated overlay layer) · ❌ `fill: '#dark.04, #surface'` (half-transparent mix) → ✅ `fill: '#surface+#dark.04'`. Write it as one word, with no spaces around `+`. Every layer after the first needs an opacity suffix, and its token must be opaque: a translucent layer token, or one that is `#clear` in some state, leaves the result see-through, so vary the suffix (`#surface+#dark.$hover`) or the whole compound per state instead. A comma mix in `fill` is deprecated too: ❌ `fill: '#dark 4%, #surface'` → ✅ `fill: '#surface+#dark.04'`. For any other mix, write `color-mix()` itself: ✅ `fill: 'color-mix(in srgb, #dark $weight, #surface)'`.
132
139
 
133
140
  ### `transition`
134
141
 
135
- Use semantic names, not CSS property names: `fade` `fill` `color` `theme` `border` `radius` `shadow` `outline` `preset` `text` `gap` `opacity` `translate` `rotate` `scale` `filter` `image` `background` `width` `height` `zIndex` `inset` `flow` `dimension`.
142
+ Use semantic names, not CSS property names: `fade` `fill` `color` `theme` `border` `radius` `shadow` `outline` `preset` `text` `gap` `opacity` `translate` `rotate` `scale` `filter` `image` `background` `width` `height` `zIndex` `inset`.
136
143
 
137
144
  ❌ `transition: 'background-color 0.2s'` → ✅ `transition: 'fill'`
138
145
 
@@ -168,13 +175,13 @@ Precedence `!` > `^` > `|` > `&`; use parentheses to override.
168
175
 
169
176
  Rules:
170
177
 
171
- 1. **`''` comes first.** The bare default is the lowest-priority state; placing it later would override everything above it.
178
+ 1. **`''` comes first.** The bare default is the lowest-priority state. Written later, it triggers a `MISPLACED_DEFAULT_STATE` warning and Tasty moves it to the front.
172
179
  2. **Every state map needs `''` or `_`** — except when extending (`tasty(Parent, …)`), where omitting `''` merges into the parent's states and including `''` replaces them wholesale.
173
180
  3. **`_` is standalone-only** and always first (with `''` right after it, if present). `_` is a never-negated fallback floor for cases where a higher-priority branch may be _unknown_ (`@supports`, container queries). If a map contains only `_` and `''`, drop the `''`.
174
181
  4. **No nested maps:** ❌ `{ hovered: { pressed: 'x' } }` → ✅ `{ 'hovered & pressed': 'x' }`
175
182
  5. **State keys never sit at the top level** of a styles object — `:hover`, `.active`, `[open]` belong inside a property value.
176
183
  6. **Write keys Tasty can fully read.** Names start with a letter (a single letter is fine: `x` → `[data-x]`); join states with an operator (`hovered & focused`, not `hovered focused`); no space between `@media` and `(`. Tasty warns (`INVALID_STATE_KEY`) and skips what it cannot read.
177
- 7. **Prefer automatic native states:** use `disabled` and `checked` in Tasty component styles instead of `[disabled]` and `[checked]`. The concise states track the corresponding native prop or attribute automatically.
184
+ 7. **Prefer automatic native states:** use `disabled`, `checked`, and `hidden` in Tasty component styles instead of `[disabled]`, `[checked]`, and `[hidden]`. Tasty sets `data-disabled`, `data-checked`, and `data-hidden` from the native props automatically.
178
185
 
179
186
  ```jsx
180
187
  color: { '': '#text', hovered: '#accent', disabled: '#text.40' }
@@ -204,11 +211,13 @@ When extending a parent's state map: `'@inherit'` reuses the parent's value for
204
211
  A **capitalized** key targets `[data-element="Name"]`, and its value must be a style object.
205
212
 
206
213
  ```jsx
207
- styles: { Title: { preset: 'h3' }, Icon: { $: '>@:last-child', color: '#accent' } }
214
+ styles: { Title: { preset: 'h3' }, Icon: { $: '>', color: { '': '#text', '@own(:last-child)': '#accent' } } }
208
215
  ```
209
216
 
210
217
  ❌ nested-selector keys (`'& .title'`, `'&:hover'`) → ✅ sub-elements and state maps. Use the `$` affix property inside a sub-element to control how its selector attaches (`>` direct child, `@` placeholder for the element itself, `&::before` for a root pseudo-element).
211
218
 
219
+ When `$` ends in a pseudo-element, `@own(…)` is the pseudo-element's own state (`'@own(:focus)'` → `::part(label):where(:focus)`). A pseudo-element has no attributes, classes, or tree position, so `@own([open])`, `@own(hovered)`, or `@own(:first-child)` there is ignored with a warning. Put a condition on the element before the pseudo-element in `$`: `$: 'a[rel="next"]::before'`.
220
+
212
221
  ## 6. Special top-level keys
213
222
 
214
223
  | Key | Shape |
@@ -6,7 +6,7 @@ Tasty is CSS-in-JS for React design systems. It is built for the point where reu
6
6
 
7
7
  Its distinctive guarantee is narrow and concrete: each property’s state map compiles into selectors that cannot compete, so one declared branch wins regardless of CSS source order.
8
8
 
9
- That does not require a big upfront configuration step. Tasty's built-in units and normal CSS color values work out of the box, and `okhsl(...)` is available immediately as the recommended path for color authoring. The extra setup comes later if a team wants shared tokens, aliases, recipes, or stricter conventions.
9
+ That does not require a big upfront configuration step. Tasty's built-in units and normal CSS color values work out of the box, and the built-in `okhsl(...)` and `okhst(...)` color functions are available immediately as the recommended path for color authoring. The extra setup comes later if a team wants shared tokens, aliases, recipes, or stricter conventions.
10
10
 
11
11
  Most styling tools focus on one of these layers:
12
12
 
@@ -95,11 +95,12 @@ That makes Tasty less of a "better way to write CSS objects" and more of a **sta
95
95
 
96
96
  Beyond state resolution, Tasty also provides several structural capabilities that reinforce the design-system layer:
97
97
 
98
- - **CSS properties as typed React props** — `styleProps` lets a component expose selected style properties as normal props (`<Button placeSelf="end">`), including state maps for responsive values. This keeps layout and composition controls inside a governed component API instead of pushing teams back to ad hoc styling escapes.
99
- - **Sub-element styling** — Compound components declare inner parts via capitalized keys in `styles` and `data-element` attributes. States, tokens, and recipes apply across the entire element tree from a single definition. See [React API — Sub-element Styling](react-api.md#sub-element-styling).
98
+ - **Typed component APIs** — `styleProps` exposes selected style properties as normal props (`<Button placeSelf="end">`, with state maps for responsive values), `modProps` turns modifiers into typed props (`size: ['sm', 'md', 'lg'] as const`), `tokenProps` passes per-instance values without generating new CSS, and `variants` gives a typed `variant` prop. Layout and composition controls stay inside a governed component API instead of pushing teams back to ad hoc styling escapes.
99
+ - **Sub-element styling** — Compound components declare inner parts via capitalized keys in `styles` and the `elements` option, which produces typed sub-components (`<Card.Title>`) that share the root's state context. States, tokens, and recipes apply across the entire element tree from a single definition. See [React API — Sub-element Styling](react-api.md#sub-element-styling).
100
+ - **Modern CSS as state keys** — Container queries, `@supports`, `:has()`, root and parent states, and `@starting-style` live in the same state maps as `:hover`, and `@keyframes`, `@property`, `@font-face`, `@counter-style`, and `@function` are built in.
100
101
  - **Auto-inferred `@property`** — When a custom property is assigned a concrete value, Tasty infers the CSS `@property` syntax and registers it automatically, enabling smooth transitions on custom properties without manual declarations.
101
102
  - **AI-friendly style definitions** — Style definitions are declarative, self-contained, and structurally consistent. AI tools can read, refactor, and generate Tasty styles as confidently as a human — no hidden cascade logic or implicit ordering to second-guess.
102
- - **Companion ecosystem** — An [ESLint plugin](https://github.com/tenphi/eslint-plugin-tasty) with 27 lint rules, a [VS Code extension](https://github.com/tenphi/tasty-vscode-extension) for syntax highlighting, and [Glaze](https://github.com/tenphi/glaze) for OKHSL color theme generation with automatic WCAG contrast solving.
103
+ - **Companion ecosystem** — An [ESLint and oxlint plugin](https://github.com/tenphi/eslint-plugin-tasty) with 40+ rules that validate styles against your project's `tasty.config.ts`, TypeScript augmentation for autocompleting your own token and preset names, a [VS Code extension](https://github.com/tenphi/tasty-vscode-extension) for syntax highlighting and snippets, and [Glaze](https://github.com/tenphi/glaze) for OKHST palette generation with WCAG and APCA contrast solving.
103
104
 
104
105
  ---
105
106
 
@@ -184,7 +185,7 @@ Every new state doubles the selector count. Miss one intersection and you ship a
184
185
  )}>
185
186
  ```
186
187
 
187
- The `theme` branch is runtime JS, not CSS. Intersections like `disabled + hover` need manual `!important` or extra utilities to override correctly.
188
+ The `theme` branch is runtime JS, not CSS. Tailwind resolves `hover:` against `disabled:` by its global variant order, not per component; when your priority differs from that order, or two base utilities conflict (`bg-primary` vs `bg-danger`), you need `tailwind-merge`, `!` modifiers, or more conditional class logic.
188
189
 
189
190
  **Tasty** — each property declares all its states in one map. The engine generates mutually exclusive selectors:
190
191
 
@@ -196,10 +197,10 @@ const Button = tasty({
196
197
  '': '#primary',
197
198
  ':hover': '#primary-hover',
198
199
  ':active': '#primary-pressed',
199
- disabled: '#surface',
200
200
  'theme=danger': '#danger',
201
201
  'theme=danger & :hover': '#danger-hover',
202
202
  'theme=danger & :active': '#danger-pressed',
203
+ disabled: '#surface',
203
204
  },
204
205
  color: {
205
206
  '': '#on-primary',
@@ -213,7 +214,7 @@ const Button = tasty({
213
214
  });
214
215
  ```
215
216
 
216
- `disabled` always wins over `:hover` because Tasty emits negation selectors — no source-order dependence, no manual intersection management, no `!important`.
217
+ `disabled` is declared last, so it wins over `:hover`, `:active`, and `theme=danger`: Tasty guards every earlier branch with `:not([data-disabled])` — no source-order dependence, no manual intersection management, no `!important`.
217
218
 
218
219
  ---
219
220
 
@@ -328,7 +329,7 @@ That makes it narrower in audience, but deeper in architectural ambition.
328
329
 
329
330
  There is also a fundamental architectural difference: Emotion and styled-components rely on React context and hooks internally, which means they require `'use client'` in modern React and cannot run as React Server Components. Tasty's style functions and `tasty()` components are hook-free, so they work as server components by default and ship no Tasty styling runtime in server-only contexts. This is not a minor compatibility detail — it means Tasty-based components stay as server components until _your_ code needs interactivity, while Emotion and styled-components force the client boundary at the styling layer.
330
331
 
331
- For teams evaluating runtime styling at scale, Tasty also documents its runtime benchmarks and caching model in the main [README](../README.md#performance). That matters, but it is still secondary to the core question of whether you want Tasty's deterministic selector model.
332
+ For teams evaluating runtime styling at scale, Tasty publishes reproducible [Runtime Benchmarks](runtime-benchmarks.md) and summarizes its caching model in the [README](../README.md#performance). That matters, but it is still secondary to the core question of whether you want Tasty's deterministic selector model.
332
333
 
333
334
  ---
334
335