@tenphi/tasty 0.0.0-snapshot.e4609d6 → 0.0.0-snapshot.e4e4347
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.
- package/README.md +436 -394
- package/dist/babel-types-BKDTT4--.d.ts +18 -0
- package/dist/chunks/async-storage-f9j9JRtq.js +37 -0
- package/dist/chunks/async-storage-f9j9JRtq.js.map +1 -0
- package/dist/chunks/build-config-5d8WlQbq.js +60 -0
- package/dist/chunks/build-config-5d8WlQbq.js.map +1 -0
- package/dist/{collector-BpkjNQDo.js → chunks/collector-CjCak4iE.js} +25 -119
- package/dist/chunks/collector-CjCak4iE.js.map +1 -0
- package/dist/chunks/config-engine-uOFYZidB.js +272 -0
- package/dist/chunks/config-engine-uOFYZidB.js.map +1 -0
- package/dist/chunks/config-file-DlZXJMj8.js +25 -0
- package/dist/chunks/config-file-DlZXJMj8.js.map +1 -0
- package/dist/chunks/css-definitions-ubrHP97m.js +910 -0
- package/dist/chunks/css-definitions-ubrHP97m.js.map +1 -0
- package/dist/chunks/css-resources-P7IBUUZs.js +142 -0
- package/dist/chunks/css-resources-P7IBUUZs.js.map +1 -0
- package/dist/chunks/debug-CJ31U_WE.js +502 -0
- package/dist/chunks/debug-CJ31U_WE.js.map +1 -0
- package/dist/chunks/dsl-DYSJc1-T.js +1383 -0
- package/dist/chunks/dsl-DYSJc1-T.js.map +1 -0
- package/dist/chunks/hydration-TRcz5vnk.js +41 -0
- package/dist/chunks/hydration-TRcz5vnk.js.map +1 -0
- package/dist/chunks/react-runtime-CyyCI02N.js +689 -0
- package/dist/chunks/react-runtime-CyyCI02N.js.map +1 -0
- package/dist/chunks/runtime-engine-BQmOu5-W.js +2432 -0
- package/dist/chunks/runtime-engine-BQmOu5-W.js.map +1 -0
- package/dist/chunks/runtime-state-DEsyUMU-.js +152 -0
- package/dist/chunks/runtime-state-DEsyUMU-.js.map +1 -0
- package/dist/{merge-styles-B0lMso5W.js → chunks/shared-utils-y-HjvPN4.js} +60 -55
- package/dist/chunks/shared-utils-y-HjvPN4.js.map +1 -0
- package/dist/chunks/style-engine-BX2LshDZ.js +5466 -0
- package/dist/chunks/style-engine-BX2LshDZ.js.map +1 -0
- package/dist/{css-writer-BHjTF0YN.js → chunks/zero-engine-Dw0P4yGM.js} +65 -145
- package/dist/chunks/zero-engine-Dw0P4yGM.js.map +1 -0
- package/dist/{collector-D8o4Wdq-.d.ts → collector-CTU-nl0g.d.ts} +23 -4
- package/dist/{config-De8L9NWM.d.ts → config-CcxqSZI2.d.ts} +274 -78
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +9 -6
- package/dist/hydrate-CRyjjAyl.d.ts +22 -0
- package/dist/{index-DzGxoeyN.d.ts → index-xtey-KDu.d.ts} +350 -253
- package/dist/index.d.ts +5 -5
- package/dist/index.js +11 -867
- package/dist/{merge-styles-DLm4wdnb.d.ts → merge-styles-DSkVc6CD.d.ts} +2 -3
- package/dist/ssr/astro-client.d.ts +1 -1
- package/dist/ssr/astro-client.js +1 -14
- package/dist/ssr/astro-client.js.map +1 -1
- package/dist/ssr/astro-middleware-extract-static.d.ts +10 -0
- package/dist/ssr/astro-middleware-extract-static.js +9 -0
- package/dist/ssr/astro-middleware-extract-static.js.map +1 -0
- package/dist/ssr/astro-middleware-extract.d.ts +10 -0
- package/dist/ssr/astro-middleware-extract.js +9 -0
- package/dist/ssr/astro-middleware-extract.js.map +1 -0
- package/dist/ssr/astro-middleware-static.d.ts +3 -2
- package/dist/ssr/astro-middleware-static.js +0 -11
- package/dist/ssr/astro-middleware-static.js.map +1 -1
- package/dist/ssr/astro-middleware.d.ts +3 -2
- package/dist/ssr/astro-middleware.js +0 -12
- package/dist/ssr/astro-middleware.js.map +1 -1
- package/dist/ssr/astro.d.ts +40 -6
- package/dist/ssr/astro.js +157 -93
- package/dist/ssr/astro.js.map +1 -1
- package/dist/ssr/client.d.ts +2 -0
- package/dist/ssr/client.js +2 -0
- package/dist/ssr/index.d.ts +5 -25
- package/dist/ssr/index.js +5 -5
- package/dist/ssr/index.js.map +1 -1
- package/dist/ssr/next-config.d.ts +64 -0
- package/dist/ssr/next-config.js +123 -0
- package/dist/ssr/next-config.js.map +1 -0
- package/dist/ssr/next.d.ts +9 -8
- package/dist/ssr/next.js +29 -43
- package/dist/ssr/next.js.map +1 -1
- package/dist/static/index.d.ts +8 -9
- package/dist/static/index.js +4 -22
- package/dist/static/index.js.map +1 -1
- package/dist/static/inject.d.ts +1 -2
- package/dist/{index-KUYya3x7.d.ts → types-DJEM_BOJ.d.ts} +741 -590
- package/dist/zero/babel.d.ts +67 -2
- package/dist/zero/babel.js +77 -140
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/index.d.ts +62 -8
- package/dist/zero/index.js +24 -2
- package/dist/zero/index.js.map +1 -0
- package/dist/zero/next.d.ts +4 -5
- package/dist/zero/next.js +3 -38
- package/dist/zero/next.js.map +1 -1
- package/docs/README.md +16 -8
- package/docs/adoption.md +69 -36
- package/docs/ai-agents.md +118 -86
- package/docs/comparison.md +77 -47
- package/docs/configuration.md +434 -108
- package/docs/debug.md +21 -8
- package/docs/design-system.md +152 -31
- package/docs/dsl.md +483 -211
- package/docs/getting-started.md +130 -50
- package/docs/injector.md +117 -68
- package/docs/methodology.md +81 -50
- package/docs/migration-v3.md +52 -52
- package/docs/pipeline.md +54 -30
- package/docs/plugins.md +59 -75
- package/docs/react-api.md +135 -53
- package/docs/runtime-benchmarks.md +388 -0
- package/docs/ssr.md +285 -101
- package/docs/styles.md +128 -33
- package/docs/tasty-static.md +272 -135
- package/package.json +119 -34
- package/dist/async-storage-DKK-wTD4.js +0 -44
- package/dist/async-storage-DKK-wTD4.js.map +0 -1
- package/dist/babel-R2qT7yLN.d.ts +0 -83
- package/dist/collector-BpkjNQDo.js.map +0 -1
- package/dist/config-DOCuTykY.js +0 -12315
- package/dist/config-DOCuTykY.js.map +0 -1
- package/dist/context-CA8YKeMn.js +0 -24
- package/dist/context-CA8YKeMn.js.map +0 -1
- package/dist/core-p6iTbQnn.js +0 -1550
- package/dist/core-p6iTbQnn.js.map +0 -1
- package/dist/css-writer-BHjTF0YN.js.map +0 -1
- package/dist/format-global-rules-DklyaXv-.js +0 -22
- package/dist/format-global-rules-DklyaXv-.js.map +0 -1
- package/dist/format-rules-Cb0YIjyS.js +0 -143
- package/dist/format-rules-Cb0YIjyS.js.map +0 -1
- package/dist/hydrate-xnaB3SDm.js +0 -37
- package/dist/hydrate-xnaB3SDm.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/keyframes-DiXjNoBZ.js +0 -424
- package/dist/keyframes-DiXjNoBZ.js.map +0 -1
- package/dist/merge-styles-B0lMso5W.js.map +0 -1
- package/dist/resolve-recipes-C9nAuwgR.js +0 -144
- package/dist/resolve-recipes-C9nAuwgR.js.map +0 -1
package/docs/comparison.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Use this guide when you are deciding whether Tasty is the right tool. If you have already decided to adopt it and need rollout guidance, use the [Adoption Guide](adoption.md) instead.
|
|
4
4
|
|
|
5
|
-
Tasty is
|
|
5
|
+
Tasty is CSS-in-JS for React design systems. It is built for the point where reusable components have enough intersecting states, variants, themes, and extension rules that ordinary selector competition becomes hard to reason about.
|
|
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(...)`
|
|
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
|
|
|
@@ -16,7 +16,7 @@ Most styling tools focus on one of these layers:
|
|
|
16
16
|
- utility composition
|
|
17
17
|
- atomic CSS generation
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
For design-system teams, that state model can sit alongside tokens, typed style props, recipes, custom units, and sub-element rules. Tasty can therefore define the styling language exposed by shared components, not just another syntax for writing CSS.
|
|
20
20
|
|
|
21
21
|
That is why syntax-level comparisons are often shallow. The more meaningful comparison is about:
|
|
22
22
|
|
|
@@ -29,14 +29,14 @@ That is why syntax-level comparisons are often shallow. The more meaningful comp
|
|
|
29
29
|
|
|
30
30
|
## High-level positioning
|
|
31
31
|
|
|
32
|
-
| System
|
|
33
|
-
|
|
34
|
-
| **Tasty**
|
|
35
|
-
| **Tailwind CSS**
|
|
36
|
-
| **Panda CSS**
|
|
37
|
-
| **vanilla-extract**
|
|
38
|
-
| **StyleX**
|
|
39
|
-
| **Stitches** (deprecated) **/ Emotion** | Component-first CSS-in-JS
|
|
32
|
+
| System | Best described as | Main authoring model | Conflict model | RSC / zero-JS SSG | Best fit |
|
|
33
|
+
| --------------------------------------- | ---------------------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------- | ------------------------------------------------------------- |
|
|
34
|
+
| **Tasty** | CSS-in-JS for React design systems | CSS-like objects with state maps, tokens, recipes, style props, and sub-elements | **Mutually exclusive selector resolution** for stateful styles | Yes — hook-free, server components by default | Teams building long-lived shared component APIs |
|
|
35
|
+
| **Tailwind CSS** | Utility-first styling framework | Utility classes in markup | Utility composition, variants, and framework-controlled ordering | Yes — no JS runtime | Product teams optimizing for speed and direct authoring |
|
|
36
|
+
| **Panda CSS** | Typed styling engine with atomic output | Typed style objects, recipes, generated primitives, style props | Atomic CSS with static analysis | Yes — build-time extraction | Teams wanting a DS-friendly engine with typed primitives |
|
|
37
|
+
| **vanilla-extract** | Zero-runtime TS-native stylesheet system | `.css.ts` files, theme contracts, style composition | Standard CSS semantics | Yes — build-time extraction | Teams wanting static CSS and low-level control |
|
|
38
|
+
| **StyleX** | Compiler-based atomic styling system | JS authoring with compiler-generated atomic CSS | Compiler-controlled atomic composition | Yes — compiler-extracted | Large app teams wanting optimized, predictable atomic styling |
|
|
39
|
+
| **Stitches** (deprecated) **/ Emotion** | Component-first CSS-in-JS | Styled components, `css()` APIs, object/string styles | Composition within CSS-in-JS rules | No — requires `'use client'` | Teams optimizing for component DX and flexible styling |
|
|
40
40
|
|
|
41
41
|
---
|
|
42
42
|
|
|
@@ -69,8 +69,12 @@ This is especially relevant for components with intersecting states such as:
|
|
|
69
69
|
Here is a minimal example. Two CSS rules for a button's background — one for `:hover`, one for `[disabled]`:
|
|
70
70
|
|
|
71
71
|
```css
|
|
72
|
-
.btn:hover
|
|
73
|
-
|
|
72
|
+
.btn:hover {
|
|
73
|
+
background: dodgerblue;
|
|
74
|
+
}
|
|
75
|
+
.btn[disabled] {
|
|
76
|
+
background: gray;
|
|
77
|
+
}
|
|
74
78
|
```
|
|
75
79
|
|
|
76
80
|
When the button is both hovered **and** disabled, both selectors match with equal specificity. The last rule in source order wins. Swap the two lines and the visual behavior silently reverses — a hovered disabled button turns blue instead of gray.
|
|
@@ -81,21 +85,22 @@ In Tasty, the same intent is declared as a state map:
|
|
|
81
85
|
fill: {
|
|
82
86
|
'': '#primary',
|
|
83
87
|
':hover': '#primary-hover',
|
|
84
|
-
'disabled': '#surface',
|
|
88
|
+
'[disabled]': '#surface',
|
|
85
89
|
}
|
|
86
90
|
```
|
|
87
91
|
|
|
88
|
-
|
|
92
|
+
Because `[disabled]` is declared later, it has higher priority. Tasty excludes disabled buttons from the hover selector, so exactly one background rule matches. The outcome is defined by the state map, not by which CSS rule comes last.
|
|
89
93
|
|
|
90
94
|
That makes Tasty less of a "better way to write CSS objects" and more of a **state-aware style compiler for design systems**.
|
|
91
95
|
|
|
92
96
|
Beyond state resolution, Tasty also provides several structural capabilities that reinforce the design-system layer:
|
|
93
97
|
|
|
94
|
-
- **
|
|
95
|
-
- **Sub-element styling** — Compound components declare inner parts via capitalized keys in `styles` and `
|
|
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.
|
|
96
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.
|
|
97
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.
|
|
98
|
-
- **Companion ecosystem** — An [ESLint plugin](https://github.com/tenphi/eslint-plugin-tasty) with
|
|
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.
|
|
99
104
|
|
|
100
105
|
---
|
|
101
106
|
|
|
@@ -131,16 +136,36 @@ To make this concrete, consider a button with `hover`, `disabled`, and `theme=da
|
|
|
131
136
|
**Plain CSS** — you need a selector for every intersection, and equal-specificity rules depend on source order:
|
|
132
137
|
|
|
133
138
|
```css
|
|
134
|
-
.btn {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
139
|
+
.btn {
|
|
140
|
+
background: var(--primary);
|
|
141
|
+
color: white;
|
|
142
|
+
cursor: pointer;
|
|
143
|
+
}
|
|
144
|
+
.btn:hover {
|
|
145
|
+
background: var(--primary-hover);
|
|
146
|
+
}
|
|
147
|
+
.btn:active {
|
|
148
|
+
background: var(--primary-pressed);
|
|
149
|
+
}
|
|
150
|
+
.btn[disabled] {
|
|
151
|
+
background: var(--surface);
|
|
152
|
+
color: var(--text-40);
|
|
153
|
+
cursor: not-allowed;
|
|
154
|
+
}
|
|
138
155
|
|
|
139
156
|
/* theme=danger overrides — must repeat disabled/hover/active */
|
|
140
|
-
.btn[data-theme=
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
.btn[data-theme=
|
|
157
|
+
.btn[data-theme='danger'] {
|
|
158
|
+
background: var(--danger);
|
|
159
|
+
}
|
|
160
|
+
.btn[data-theme='danger']:hover {
|
|
161
|
+
background: var(--danger-hover);
|
|
162
|
+
}
|
|
163
|
+
.btn[data-theme='danger']:active {
|
|
164
|
+
background: var(--danger-pressed);
|
|
165
|
+
}
|
|
166
|
+
.btn[data-theme='danger'][disabled] {
|
|
167
|
+
background: var(--surface);
|
|
168
|
+
}
|
|
144
169
|
|
|
145
170
|
/* Bug: .btn:hover and .btn[disabled] have the same specificity.
|
|
146
171
|
A hovered disabled button gets :hover styles — unless source order saves you. */
|
|
@@ -160,7 +185,7 @@ Every new state doubles the selector count. Miss one intersection and you ship a
|
|
|
160
185
|
)}>
|
|
161
186
|
```
|
|
162
187
|
|
|
163
|
-
The `theme` branch is runtime JS, not CSS.
|
|
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.
|
|
164
189
|
|
|
165
190
|
**Tasty** — each property declares all its states in one map. The engine generates mutually exclusive selectors:
|
|
166
191
|
|
|
@@ -172,24 +197,24 @@ const Button = tasty({
|
|
|
172
197
|
'': '#primary',
|
|
173
198
|
':hover': '#primary-hover',
|
|
174
199
|
':active': '#primary-pressed',
|
|
175
|
-
'disabled': '#surface',
|
|
176
200
|
'theme=danger': '#danger',
|
|
177
201
|
'theme=danger & :hover': '#danger-hover',
|
|
178
202
|
'theme=danger & :active': '#danger-pressed',
|
|
203
|
+
disabled: '#surface',
|
|
179
204
|
},
|
|
180
205
|
color: {
|
|
181
206
|
'': '#on-primary',
|
|
182
|
-
|
|
207
|
+
disabled: '#text.40',
|
|
183
208
|
},
|
|
184
209
|
cursor: {
|
|
185
210
|
'': 'pointer',
|
|
186
|
-
|
|
211
|
+
disabled: 'not-allowed',
|
|
187
212
|
},
|
|
188
213
|
},
|
|
189
214
|
});
|
|
190
215
|
```
|
|
191
216
|
|
|
192
|
-
`disabled`
|
|
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`.
|
|
193
218
|
|
|
194
219
|
---
|
|
195
220
|
|
|
@@ -235,12 +260,12 @@ Tasty is more opinionated.
|
|
|
235
260
|
|
|
236
261
|
It behaves less like "TypeScript that outputs CSS" and more like a **state-aware style compiler**. It is designed to encode higher-level styling semantics rather than only expose CSS primitives in typed form.
|
|
237
262
|
|
|
238
|
-
This also makes Tasty's
|
|
263
|
+
This also makes Tasty's delivery model notable:
|
|
239
264
|
|
|
240
|
-
- `tasty()` components are hook-free and work as React Server Components. In server-only contexts
|
|
241
|
-
- `tastyStatic()` with the Babel plugin produces static class
|
|
265
|
+
- `tasty()` components are hook-free and work as React Server Components. In server-only contexts, they produce HTML + CSS with zero Tasty styling runtime in the browser while retaining the full React feature set. Astro without islands is the concrete integration; server-only Next.js RSC uses the same architecture.
|
|
266
|
+
- `tastyStatic()` with the Babel plugin produces static class-name objects via build-time extraction, with no React dependency — the output works with any JavaScript framework.
|
|
242
267
|
|
|
243
|
-
|
|
268
|
+
React component features like `styleProps`, sub-element components, and dynamic variants are available in the `tasty()` path whether it renders on the server or in the browser. The `tastyStatic()` path is framework-agnostic but limited to the DSL, tokens, and state logic.
|
|
244
269
|
|
|
245
270
|
So the tradeoff is roughly:
|
|
246
271
|
|
|
@@ -298,32 +323,32 @@ It is less focused on "how do I style this component ergonomically right now?" a
|
|
|
298
323
|
- what should be allowed or constrained?
|
|
299
324
|
- how do we keep style behavior deterministic as the system grows?
|
|
300
325
|
|
|
301
|
-
So while Stitches and Emotion are strong tools for building components, Tasty is more naturally positioned as
|
|
326
|
+
So while Stitches and Emotion are strong tools for building components, Tasty is more naturally positioned as the **styling engine underneath a design system’s component API**.
|
|
302
327
|
|
|
303
328
|
That makes it narrower in audience, but deeper in architectural ambition.
|
|
304
329
|
|
|
305
|
-
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
|
|
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.
|
|
306
331
|
|
|
307
|
-
For teams evaluating runtime styling at scale, Tasty
|
|
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.
|
|
308
333
|
|
|
309
334
|
---
|
|
310
335
|
|
|
311
|
-
##
|
|
336
|
+
## Where styles are computed
|
|
312
337
|
|
|
313
338
|
Tasty is not limited to one execution model.
|
|
314
339
|
|
|
315
|
-
|
|
340
|
+
Zero-runtime delivery is an outcome, not a synonym for `tastyStatic()`. `tasty()` computes styles during React rendering, but that rendering can happen only on the server. In that case it produces HTML + CSS and ships **zero Tasty styling runtime** to the browser. The full feature set — `styleProps`, sub-elements, variants, state maps — remains available. Astro's `tastyIntegration({ islands: false })` is the explicit setup for this path. Server-only Next.js RSC follows the same architecture; verify the generated output for the target deployment.
|
|
316
341
|
|
|
317
342
|
Client JavaScript only enters the picture when a component needs React interactivity (state, effects, event handlers) — and that is the consuming component's decision, never Tasty's. Tasty never forces the `'use client'` boundary.
|
|
318
343
|
|
|
319
|
-
`tastyStatic()` with the Babel plugin
|
|
344
|
+
`tastyStatic()` with the Babel plugin reaches zero-runtime delivery differently: CSS is extracted **during the build**, without React. The output is framework-agnostic — any JavaScript framework can consume the resulting class names and CSS. This makes Tasty usable as the compiler layer underneath a design-system implementation, even outside the React ecosystem.
|
|
320
345
|
|
|
321
346
|
The tradeoff is that some capabilities — `styleProps`, sub-element components (`<Card.Title>`), dynamic variants — are tied to the `tasty()` path. The `tastyStatic()` path is best understood as extraction and compilation of the DSL, tokens, and state logic without a React dependency.
|
|
322
347
|
|
|
323
|
-
This
|
|
348
|
+
This gives Tasty two zero-runtime paths:
|
|
324
349
|
|
|
325
|
-
- `tasty()`
|
|
326
|
-
- `tastyStatic()` as a
|
|
350
|
+
- server-only `tasty()` for the full React component API, with CSS generated during server or static rendering
|
|
351
|
+
- `tastyStatic()` as a build-time compiler whose output works with any framework, including non-React ones
|
|
327
352
|
|
|
328
353
|
---
|
|
329
354
|
|
|
@@ -332,22 +357,27 @@ This flexibility is one of Tasty's more unusual strengths:
|
|
|
332
357
|
Another useful way to think about the ecosystem is by abstraction level.
|
|
333
358
|
|
|
334
359
|
### Direct styling tools
|
|
360
|
+
|
|
335
361
|
These are optimized for styling product code directly.
|
|
336
362
|
|
|
337
363
|
Examples:
|
|
364
|
+
|
|
338
365
|
- Tailwind CSS
|
|
339
366
|
- Emotion (requires `'use client'` — not RSC-compatible)
|
|
340
367
|
- Stitches (deprecated, requires `'use client'`)
|
|
341
368
|
|
|
342
369
|
### Typed styling engines
|
|
370
|
+
|
|
343
371
|
These are optimized for generating CSS with stronger structure and tooling.
|
|
344
372
|
|
|
345
373
|
Examples:
|
|
374
|
+
|
|
346
375
|
- Panda CSS
|
|
347
376
|
- vanilla-extract
|
|
348
377
|
- StyleX
|
|
349
378
|
|
|
350
379
|
### Design-system language engines
|
|
380
|
+
|
|
351
381
|
These are optimized for helping a team define its own styling grammar and semantics.
|
|
352
382
|
|
|
353
383
|
Tasty belongs most naturally here.
|
|
@@ -364,7 +394,7 @@ Tasty makes the most sense when:
|
|
|
364
394
|
- a shared component API is emerging even if the design system is still lightweight
|
|
365
395
|
- styling should be governed through a central platform team
|
|
366
396
|
- component state logic is complex
|
|
367
|
-
- the team wants a
|
|
397
|
+
- the team wants a design-system-owned styling language instead of raw CSS-shaped authoring
|
|
368
398
|
- tokens, recipes, and sub-elements should be first-class
|
|
369
399
|
- deterministic state resolution matters more than minimum abstraction overhead
|
|
370
400
|
- the styling engine may need to work as either a runtime tool or a build-time compiler
|
|
@@ -414,6 +444,6 @@ Tasty is most compelling when the problem is not just "how do we write styles,"
|
|
|
414
444
|
- [React API](react-api.md) — `tasty()` factory, component props, variants, sub-elements, style functions
|
|
415
445
|
- [Style Properties](styles.md) — complete reference for all enhanced style properties
|
|
416
446
|
- [Configuration](configuration.md) — tokens, recipes, custom units, style handlers, and TypeScript extensions
|
|
417
|
-
- [
|
|
447
|
+
- [Build-Time Extraction (`tastyStatic`)](tasty-static.md) — static styling with the Babel plugin
|
|
418
448
|
- [Adoption Guide](adoption.md) — where Tasty sits in the stack, incremental adoption, and what changes for product engineers
|
|
419
449
|
- [Server-Side Rendering](ssr.md) — SSR setup for Next.js, Astro, and generic frameworks
|