@tenphi/tasty 0.0.0-snapshot.0003ae6

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 (104) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +685 -0
  3. package/dist/babel-rZcEwPLM.d.ts +82 -0
  4. package/dist/chunks/async-storage-CG5HnUT5.js +20 -0
  5. package/dist/chunks/async-storage-CG5HnUT5.js.map +1 -0
  6. package/dist/chunks/build-config-_cm7XDZ0.js +42 -0
  7. package/dist/chunks/build-config-_cm7XDZ0.js.map +1 -0
  8. package/dist/chunks/collector-DZh0frqA.js +208 -0
  9. package/dist/chunks/collector-DZh0frqA.js.map +1 -0
  10. package/dist/chunks/config-engine-B9arIU78.js +272 -0
  11. package/dist/chunks/config-engine-B9arIU78.js.map +1 -0
  12. package/dist/chunks/css-definitions-LxHlQWqa.js +876 -0
  13. package/dist/chunks/css-definitions-LxHlQWqa.js.map +1 -0
  14. package/dist/chunks/css-resources-P7IBUUZs.js +142 -0
  15. package/dist/chunks/css-resources-P7IBUUZs.js.map +1 -0
  16. package/dist/chunks/debug-Cp6kyH_o.js +502 -0
  17. package/dist/chunks/debug-Cp6kyH_o.js.map +1 -0
  18. package/dist/chunks/dsl-MW8TZusz.js +1377 -0
  19. package/dist/chunks/dsl-MW8TZusz.js.map +1 -0
  20. package/dist/chunks/hydration-TRcz5vnk.js +41 -0
  21. package/dist/chunks/hydration-TRcz5vnk.js.map +1 -0
  22. package/dist/chunks/react-runtime-DFK-u-KU.js +562 -0
  23. package/dist/chunks/react-runtime-DFK-u-KU.js.map +1 -0
  24. package/dist/chunks/runtime-engine-BNE2KUiS.js +2412 -0
  25. package/dist/chunks/runtime-engine-BNE2KUiS.js.map +1 -0
  26. package/dist/chunks/runtime-state-BsBWQeBn.js +127 -0
  27. package/dist/chunks/runtime-state-BsBWQeBn.js.map +1 -0
  28. package/dist/chunks/shared-utils-CGMsLq--.js +148 -0
  29. package/dist/chunks/shared-utils-CGMsLq--.js.map +1 -0
  30. package/dist/chunks/style-engine-BuW7q07d.js +5260 -0
  31. package/dist/chunks/style-engine-BuW7q07d.js.map +1 -0
  32. package/dist/chunks/zero-engine-DzsBXgfk.js +275 -0
  33. package/dist/chunks/zero-engine-DzsBXgfk.js.map +1 -0
  34. package/dist/collector-w4mBj5gd.d.ts +164 -0
  35. package/dist/config-CZWCzBr6.d.ts +1349 -0
  36. package/dist/core/index.d.ts +5 -0
  37. package/dist/core/index.js +9 -0
  38. package/dist/index-G9JuwM9p.d.ts +1920 -0
  39. package/dist/index.d.ts +5 -0
  40. package/dist/index.js +11 -0
  41. package/dist/merge-styles-VXwJ0Frr.d.ts +6 -0
  42. package/dist/ssr/astro-client.d.ts +1 -0
  43. package/dist/ssr/astro-client.js +6 -0
  44. package/dist/ssr/astro-client.js.map +1 -0
  45. package/dist/ssr/astro-middleware-extract-static.d.ts +10 -0
  46. package/dist/ssr/astro-middleware-extract-static.js +9 -0
  47. package/dist/ssr/astro-middleware-extract-static.js.map +1 -0
  48. package/dist/ssr/astro-middleware-extract.d.ts +10 -0
  49. package/dist/ssr/astro-middleware-extract.js +9 -0
  50. package/dist/ssr/astro-middleware-extract.js.map +1 -0
  51. package/dist/ssr/astro-middleware-static.d.ts +17 -0
  52. package/dist/ssr/astro-middleware-static.js +7 -0
  53. package/dist/ssr/astro-middleware-static.js.map +1 -0
  54. package/dist/ssr/astro-middleware.d.ts +18 -0
  55. package/dist/ssr/astro-middleware.js +7 -0
  56. package/dist/ssr/astro-middleware.js.map +1 -0
  57. package/dist/ssr/astro.d.ts +127 -0
  58. package/dist/ssr/astro.js +221 -0
  59. package/dist/ssr/astro.js.map +1 -0
  60. package/dist/ssr/index.d.ts +36 -0
  61. package/dist/ssr/index.js +10 -0
  62. package/dist/ssr/index.js.map +1 -0
  63. package/dist/ssr/next-config.d.ts +64 -0
  64. package/dist/ssr/next-config.js +128 -0
  65. package/dist/ssr/next-config.js.map +1 -0
  66. package/dist/ssr/next.d.ts +46 -0
  67. package/dist/ssr/next.js +60 -0
  68. package/dist/ssr/next.js.map +1 -0
  69. package/dist/static/index.d.ts +90 -0
  70. package/dist/static/index.js +32 -0
  71. package/dist/static/index.js.map +1 -0
  72. package/dist/static/inject.d.ts +4 -0
  73. package/dist/static/inject.js +17 -0
  74. package/dist/static/inject.js.map +1 -0
  75. package/dist/types-JEY8PVYP.d.ts +1567 -0
  76. package/dist/zero/babel.d.ts +2 -0
  77. package/dist/zero/babel.js +412 -0
  78. package/dist/zero/babel.js.map +1 -0
  79. package/dist/zero/index.d.ts +80 -0
  80. package/dist/zero/index.js +2 -0
  81. package/dist/zero/next.d.ts +84 -0
  82. package/dist/zero/next.js +112 -0
  83. package/dist/zero/next.js.map +1 -0
  84. package/docs/README.md +39 -0
  85. package/docs/adoption.md +323 -0
  86. package/docs/ai-agents.md +250 -0
  87. package/docs/comparison.md +448 -0
  88. package/docs/configuration.md +839 -0
  89. package/docs/debug.md +332 -0
  90. package/docs/design-system.md +455 -0
  91. package/docs/dsl.md +1065 -0
  92. package/docs/getting-started.md +240 -0
  93. package/docs/injector.md +634 -0
  94. package/docs/methodology.md +648 -0
  95. package/docs/migration-v3.md +285 -0
  96. package/docs/pipeline.md +765 -0
  97. package/docs/plugins.md +353 -0
  98. package/docs/react-api.md +683 -0
  99. package/docs/runtime-benchmarks.md +388 -0
  100. package/docs/ssr.md +610 -0
  101. package/docs/styles.md +715 -0
  102. package/docs/tasty-static.md +582 -0
  103. package/package.json +314 -0
  104. package/tasty.config.ts +20 -0
@@ -0,0 +1,250 @@
1
+ # Tasty Style Rules for AI Agents
2
+
3
+ A compact ruleset for **writing correct `@tenphi/tasty` styles**. It is not an API tour — most rules here are machine-checked by [`@tenphi/eslint-plugin-tasty`](https://www.npmjs.com/package/@tenphi/eslint-plugin-tasty), so following it generally means clean lint output. The plugin ships separately and can lag a new DSL rule, so treat this page as the source of truth and the plugin as the enforcement that catches most of it. For explanations and the complete API, see [Style DSL](dsl.md), [Style Properties](styles.md), [React API](react-api.md).
4
+
5
+ Notation: ❌ wrong → ✅ correct.
6
+
7
+ ---
8
+
9
+ ## 0. Read the project config first
10
+
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
+
13
+ ## 1. Where styles go
14
+
15
+ ```jsx
16
+ const Card = tasty({ as: 'div', styles: { … }, styleProps: ['padding'] }); // new component
17
+ const Hero = tasty(Card, { styles: { … } }); // extend a component
18
+ const cls = useStyles({ … }); // ad-hoc class name
19
+ tastyStatic('.card', { … }); // build-time extraction
20
+ ```
21
+
22
+ - Wrap, don't pass styles per instance: ❌ `<Box styles={{ padding: '2x' }} />` → ✅ `const Box = tasty({ styles: { padding: '2x' } })`.
23
+ - Style values are **static**. Route anything conditional through a state map plus `mods` (or `tokens` / `styleProps`):
24
+ ❌ `fill: isOpen ? '#primary' : '#surface'` → ✅ `fill: { '': '#surface', open: '#primary' }` with `mods={{ open: isOpen }}`.
25
+ - Keep JavaScript identifiers, calls, computed keys, and interpolated templates
26
+ out of style values. Use token references inside strings for values supplied
27
+ at runtime. Spell out style properties rather than spreading objects; if a
28
+ runtime spread is unavoidable, add a
29
+ `// eslint-disable-next-line tasty/no-style-spread -- reason` comment directly
30
+ above it. `tastyStatic()` cannot use spreads.
31
+
32
+ ## 2. Property names
33
+
34
+ Keys are camelCase — a Tasty property or a real CSS property. No kebab-case, no invented names.
35
+
36
+ Prefer the Tasty shorthand over its CSS equivalents:
37
+
38
+ | Use | Instead of |
39
+ | ---------------------------------------- | ------------------------------------------------------------------------------------- |
40
+ | `fill` | `backgroundColor`, `background` |
41
+ | `image` | `backgroundImage` |
42
+ | `border` | `borderColor`, `borderWidth`, `borderStyle`, `borderTop`/`Right`/`Bottom`/`Left` |
43
+ | `radius` | `borderRadius` |
44
+ | `outline` | `outlineColor`, `outlineWidth`, `outlineStyle`, `outlineOffset` |
45
+ | `shadow` | `boxShadow` |
46
+ | `padding` | `paddingTop`/`Right`/`Bottom`/`Left` |
47
+ | `margin` | `marginTop`/`Right`/`Bottom`/`Left` |
48
+ | `inset` | `top`, `right`, `bottom`, `left` |
49
+ | `width` / `height` | `minWidth`/`maxWidth`, `minHeight`/`maxHeight` |
50
+ | `flow` | `flexDirection`, `flexWrap`, `flexFlow`, `gridAutoFlow` |
51
+ | `preset` | `fontSize`, `lineHeight`, `letterSpacing`, `fontWeight`, `fontStyle`, `textTransform` |
52
+ | `font` | `fontFamily` |
53
+ | `scrollbar` | `scrollbarWidth`, `scrollbarColor`, `scrollbarGutter` |
54
+ | `gridColumns` / `gridRows` / `gridAreas` | `gridTemplateColumns` / `Rows` / `Areas` |
55
+ | `textOverflow: 'ellipsis / 3'` | `lineClamp` |
56
+ | `hide: true` | `display: 'none'` |
57
+ | `flexGrow` / `flexShrink` / `flexBasis` | `flex` |
58
+
59
+ Use logical category styles when layout must follow writing mode or direction: `blockSize`/`inlineSize`, `blockPadding`/`inlinePadding`, `blockMargin`/`inlineMargin`, `blockInset`/`inlineInset`, `blockScrollMargin`/`inlineScrollMargin`, `blockScrollPadding`/`inlineScrollPadding`, and `blockBorder`/`inlineBorder`. Use `start`/`end` value modifiers; do not replace them with physical sides. Native logical CSS properties remain valid as ordinary keys when an individual declaration is needed.
60
+
61
+ The last row goes the other way — longhands over the shorthand — because `flex` is lossy: it resets the components you omit to non-initial values (`flex: '0'` silently sets `flex-basis: 0%`) and cannot express `flexShrink: 0` at all. The longhands also carry separate state maps.
62
+
63
+ ## 3. Values
64
+
65
+ ### Tokens
66
+
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).
79
+ - ❌ `var(--gap)` → ✅ `$gap` · ❌ `$accent-color` → ✅ `#accent` · ❌ `transparent` → ✅ `#clear` · ❌ `currentColor` → ✅ `#current`.
80
+ - A `$name` must be declared as a `'$name': value` key in the same styles object, or in the config.
81
+ - Names are case-sensitive and start lowercase — `$myVar` → `--myVar`; a leading capital folds (`$Foo` → `--foo`). Prefer kebab-case.
82
+ - 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.
83
+ - `preset` and `transition` take token _names_, not values, so a `$name` cannot stand in for one (it warns in dev and is ignored).
84
+
85
+ ### Units
86
+
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.
88
+
89
+ Prefer units over raw pixels: `8px` → `1x` … `64px` → `8x`; `radius: '6px'` → `'1r'`; `border: '1px …'` → `'1bw …'`.
90
+
91
+ ### Math
92
+
93
+ ❌ `calc(100% - 2x)` → ✅ `(100% - 2x)`. Parentheses are wrapped in `calc()` automatically — and must be balanced.
94
+
95
+ ### `true`
96
+
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.
98
+
99
+ ### `!important`
100
+
101
+ Never use it. Tasty owns specificity through doubled selectors and state ordering; `!important` breaks that. Express the exception as a state instead.
102
+
103
+ ### Modifiers
104
+
105
+ 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
+
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 |
122
+
123
+ Directional modifiers beat placeholder zeros:
124
+
125
+ - ❌ `padding: '0 0 2x 0'` → ✅ `padding: '2x bottom'`
126
+ - ❌ `padding: '1x 1x 2x 1x'` → ✅ `padding: '1x, 2x bottom'`
127
+ - ❌ `border: '0 0 1bw 0'` — four tokens parse as _one_ border value, so this renders no border at all → ✅ `border: '1bw bottom'`
128
+ - ❌ `padding: '2x 4x top right'` — a directional group takes one value, so `4x` is dropped → ✅ `padding: '2x top, 4x right'`
129
+ - ❌ `fade: '3x 1x top bottom'` → ✅ `fade: '3x top, 1x bottom'`
130
+
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.
132
+
133
+ ### `transition`
134
+
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`.
136
+
137
+ ❌ `transition: 'background-color 0.2s'` → ✅ `transition: 'fill'`
138
+
139
+ Omit the duration to use `$fill-transition` with `$transition` as fallback, or
140
+ use a duration token explicitly (`transition: 'fill $transition'`). Avoid raw
141
+ time values in duration slots. An explicit zero can be useful to disable motion.
142
+
143
+ Use `transition` when defining a complete transition, and the native CSS
144
+ `animation` shorthand when defining a complete animation. Tasty accepts
145
+ `animation` directly and tracks local keyframes referenced by it; no special
146
+ animation handler is needed. Use duration tokens in either form. Keep
147
+ `transitionDuration`, `animationDuration`, and other motion longhands when a
148
+ state or extension changes only one part of an existing effect. A shorthand
149
+ resets omitted parts, including an animation's timeline and range.
150
+
151
+ ## 4. State maps
152
+
153
+ A property value can be an object of `state: value`. Key order is priority — later keys win.
154
+
155
+ | Key | Generated selector |
156
+ | ------------------------ | ----------------------------------------------- |
157
+ | `hovered` | `[data-hovered]` (boolean modifier from `mods`) |
158
+ | `theme=danger` | `[data-theme="danger"]` (value modifier) |
159
+ | `:hover` | pseudo-class |
160
+ | `.active` | class selector |
161
+ | `[aria-expanded="true"]` | attribute selector |
162
+ | `hovered & .active` | AND |
163
+ | `hovered \| focused` | OR (`,` also means OR) |
164
+ | `!disabled` | NOT |
165
+ | `hovered ^ focused` | XOR — exactly one (keep chains ≤ 4 operands) |
166
+
167
+ Precedence `!` > `^` > `|` > `&`; use parentheses to override.
168
+
169
+ Rules:
170
+
171
+ 1. **`''` comes first.** The bare default is the lowest-priority state; placing it later would override everything above it.
172
+ 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
+ 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
+ 4. **No nested maps:** ❌ `{ hovered: { pressed: 'x' } }` → ✅ `{ 'hovered & pressed': 'x' }`
175
+ 5. **State keys never sit at the top level** of a styles object — `:hover`, `.active`, `[open]` belong inside a property value.
176
+ 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.
178
+
179
+ ```jsx
180
+ color: { '': '#text', hovered: '#accent', disabled: '#text.40' }
181
+ ```
182
+
183
+ Advanced states:
184
+
185
+ | Prefix | Use | Example |
186
+ | -------------- | -------------------------------------------------------------------------------- | --------------------------------------------------- |
187
+ | `@media(…)` | media query; dimensions `w` `h`; types `@media:print` `:screen` `:all` `:speech` | `@media(w < 768px)`, `@media(600px <= w < 1200px)` |
188
+ | `@(…)` | container query; dimensions `w` `h` `is` `bs` | `@(layout, w >= 600px)`, `@($variant=primary)` |
189
+ | `@supports(…)` | feature query; `$` first argument tests a selector | `@supports(display: grid)`, `@supports($, :has(*))` |
190
+ | `@root(…)` | condition on `:root` | `@root(schema=dark)` |
191
+ | `@parent(…)` | condition on an ancestor; `, >` for the direct parent | `@parent(hovered, >)` |
192
+ | `@own(…)` | a sub-element's own state — **only inside sub-element styles** | `@own(:hover)` |
193
+ | `@starting` | `@starting-style` entry animation | `@starting` |
194
+ | `@name` | project state alias | `@mobile` |
195
+
196
+ - At root level write the selector directly: ❌ `'@own(:hover)'` → ✅ `':hover'`.
197
+ - `@name` aliases must exist in `states` in the config or be declared locally as an `'@name': '<state expression>'` key; alias keys start with `@` and their value must be a valid state expression.
198
+ - `:is()` / `:has()` / `:not()` / `:where()` work in state keys but support at most 2 levels of nested parentheses, and `:has()` is expensive — prefer `@parent()`, `@own()` and modifiers.
199
+
200
+ When extending a parent's state map: `'@inherit'` reuses the parent's value for that state, `null` removes a state (or resets a property, letting recipes fill in), `false` is a tombstone that blocks it entirely.
201
+
202
+ ## 5. Sub-elements
203
+
204
+ A **capitalized** key targets `[data-element="Name"]`, and its value must be a style object.
205
+
206
+ ```jsx
207
+ styles: { Title: { preset: 'h3' }, Icon: { $: '>@:last-child', color: '#accent' } }
208
+ ```
209
+
210
+ ❌ 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
+
212
+ ## 6. Special top-level keys
213
+
214
+ | Key | Shape |
215
+ | ---------------- | ----------------------------------------------------------------------------------------------------------- |
216
+ | `@keyframes` | `{ name: { '0%': styles, … } }` |
217
+ | `@property` | `{ '$name': { syntax, inherits, initialValue } }` |
218
+ | `@font-face` | `{ 'Family Name': descriptors \| descriptors[] }` |
219
+ | `@counter-style` | `{ name: descriptors }` |
220
+ | `@function` | `{ '$$name': { args, returns?, result, '$local'? } }` |
221
+ | `recipe` | a **string** of configured recipe names: `'card elevated'`, `'reset input / autofill'`, `'none / disabled'` |
222
+
223
+ `recipe` resolves on the component root and independently in each sub-element's styles: `styles: { Panel: { recipe: 'card elevated' } }` is supported. Configured recipe definitions must be flat and cannot contain their own `recipe` key; references inside recipe values are not recursively expanded. Compose names where the recipe is applied, not inside `configure({ recipes })`. See [Recipes](dsl.md#recipes).
224
+
225
+ At-rule keys match the real CSS at-rule names, so they are kebab-case, not camelCase. Inside `@function`, the callable is `$$name` but its parameters and local variables are `$name`:
226
+
227
+ ```jsx
228
+ styles: {
229
+ '@function': { $$negative: { args: ['$value'], result: '(-1 * $value)' } },
230
+ margin: '$$negative(2x) top',
231
+ }
232
+ ```
233
+
234
+ ## 7. `tastyStatic()`
235
+
236
+ The selector must be a string literal and valid CSS. Values must be static — strings, numbers, booleans, `null`, or objects/arrays of those. No variables, template literals, function calls, or spreads.
237
+
238
+ ## 8. Checklist
239
+
240
+ - Token, preset, recipe, unit and `@alias` names exist in the project config.
241
+ - Tasty shorthand chosen over CSS longhands; `flexGrow`/`flexShrink`/`flexBasis` over `flex`; `hide: true` over `display: 'none'`.
242
+ - Logical category styles keep native `block`/`inline` declarations and accept `start`/`end`, never physical direction modifiers.
243
+ - Colors are `#tokens`, not hex/rgb/oklch/named; `$prop` not `var(--prop)`.
244
+ - Spacing uses `x`/`r`/`bw`/`ow` units; math uses `(…)`, not `calc(…)`.
245
+ - `true` only on the properties that accept it; no `!important`.
246
+ - Modifiers valid for the property; directional shorthand instead of placeholder zeros.
247
+ - Every state map starts with `''` (or `_`), is flat, and lives inside a property value.
248
+ - `@own()` only inside sub-elements; sub-element keys are capitalized and hold objects.
249
+ - At-rule keys are kebab-case (`@property`, `@font-face`, `@counter-style`, `@function`); `@function` names use `$$`, their args and locals use `$`.
250
+ - Values are static; dynamic behavior comes from `mods` / `tokens` / `styleProps`.