@tenphi/tasty 0.0.0-snapshot.06c8a41 → 0.0.0-snapshot.07ea4a0
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 +408 -385
- 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-CW4k04_V.js +60 -0
- package/dist/chunks/build-config-CW4k04_V.js.map +1 -0
- package/dist/{collector-B3OsM252.js → chunks/collector-DKWQXEwN.js} +10 -127
- package/dist/chunks/collector-DKWQXEwN.js.map +1 -0
- package/dist/chunks/config-engine-DTglOA78.js +272 -0
- package/dist/chunks/config-engine-DTglOA78.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-_C7C-daI.js +910 -0
- package/dist/chunks/css-definitions-_C7C-daI.js.map +1 -0
- package/dist/{css-resources-Cyl_axbI.js → chunks/css-resources-P7IBUUZs.js} +2 -9
- package/dist/chunks/css-resources-P7IBUUZs.js.map +1 -0
- package/dist/chunks/debug-BapJwy9w.js +502 -0
- package/dist/chunks/debug-BapJwy9w.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-DayjnPuC.js +689 -0
- package/dist/chunks/react-runtime-DayjnPuC.js.map +1 -0
- package/dist/chunks/runtime-engine-IwGbSMb4.js +2432 -0
- package/dist/chunks/runtime-engine-IwGbSMb4.js.map +1 -0
- package/dist/chunks/runtime-state-CVrL92zX.js +152 -0
- package/dist/chunks/runtime-state-CVrL92zX.js.map +1 -0
- package/dist/{merge-styles-DuoZEsm9.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-CVmNIjow.js +5521 -0
- package/dist/chunks/style-engine-CVmNIjow.js.map +1 -0
- package/dist/{css-writer-Bgowobbx.js → chunks/zero-engine-igHhzYM6.js} +65 -145
- package/dist/chunks/zero-engine-igHhzYM6.js.map +1 -0
- package/dist/{collector-BTVXj2hS.d.ts → collector-CTU-nl0g.d.ts} +6 -5
- package/dist/{config-LfIDmVHx.d.ts → config-CcxqSZI2.d.ts} +45 -40
- 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-Bm9ltvdH.d.ts → index--GdqCPlp.d.ts} +271 -242
- package/dist/index.d.ts +5 -5
- package/dist/index.js +11 -922
- package/dist/{merge-styles-BcLl1u_d.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 +1 -2
- package/dist/ssr/astro-middleware-extract-static.js +1 -1
- package/dist/ssr/astro-middleware-extract.d.ts +1 -2
- package/dist/ssr/astro-middleware-extract.js +1 -1
- package/dist/ssr/astro-middleware-static.d.ts +1 -2
- package/dist/ssr/astro-middleware-static.js +1 -12
- package/dist/ssr/astro-middleware-static.js.map +1 -1
- package/dist/ssr/astro-middleware.d.ts +1 -2
- package/dist/ssr/astro-middleware.js +1 -13
- package/dist/ssr/astro-middleware.js.map +1 -1
- package/dist/ssr/astro.d.ts +8 -16
- package/dist/ssr/astro.js +220 -1
- package/dist/ssr/astro.js.map +1 -0
- 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 +3 -5
- package/dist/ssr/next-config.js +43 -35
- package/dist/ssr/next-config.js.map +1 -1
- package/dist/ssr/next.d.ts +3 -9
- package/dist/ssr/next.js +7 -38
- 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-BmogEzTo.d.ts → types-DJEM_BOJ.d.ts} +852 -860
- 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 +4 -1
- package/docs/adoption.md +25 -17
- package/docs/ai-agents.md +66 -33
- package/docs/comparison.md +9 -8
- package/docs/configuration.md +192 -60
- package/docs/debug.md +5 -7
- package/docs/design-system.md +117 -15
- package/docs/dsl.md +204 -82
- package/docs/getting-started.md +81 -22
- package/docs/injector.md +41 -40
- package/docs/methodology.md +48 -23
- package/docs/migration-v3.md +3 -3
- package/docs/pipeline.md +54 -27
- package/docs/plugins.md +22 -42
- package/docs/react-api.md +72 -9
- package/docs/runtime-benchmarks.md +146 -91
- package/docs/ssr.md +92 -66
- package/docs/styles.md +117 -31
- package/docs/tasty-static.md +162 -58
- package/package.json +96 -38
- package/dist/astro-CeYENy2x.js +0 -301
- package/dist/astro-CeYENy2x.js.map +0 -1
- package/dist/async-storage-DKK-wTD4.js +0 -44
- package/dist/async-storage-DKK-wTD4.js.map +0 -1
- package/dist/babel-DWCsafYw.d.ts +0 -83
- package/dist/collector-B3OsM252.js.map +0 -1
- package/dist/config-B3gPdCqd.js +0 -12421
- package/dist/config-B3gPdCqd.js.map +0 -1
- package/dist/context-CA8YKeMn.js +0 -24
- package/dist/context-CA8YKeMn.js.map +0 -1
- package/dist/core-DGm0CFHP.js +0 -1732
- package/dist/core-DGm0CFHP.js.map +0 -1
- package/dist/css-resources-Cyl_axbI.js.map +0 -1
- package/dist/css-writer-Bgowobbx.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-XRw9u7d4.js +0 -104
- package/dist/format-rules-XRw9u7d4.js.map +0 -1
- package/dist/hydrate-CNOmZprz.js +0 -37
- package/dist/hydrate-CNOmZprz.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/keyframes-DE-OE76F.js +0 -535
- package/dist/keyframes-DE-OE76F.js.map +0 -1
- package/dist/merge-styles-DuoZEsm9.js.map +0 -1
- package/dist/resolve-recipes-H9NqOQuP.js +0 -144
- package/dist/resolve-recipes-H9NqOQuP.js.map +0 -1
- package/dist/ssr-collector-ref-COs_ioWl.js +0 -29
- package/dist/ssr-collector-ref-COs_ioWl.js.map +0 -1
package/docs/styles.md
CHANGED
|
@@ -10,6 +10,8 @@ The properties documented below have **custom handlers** with enhanced syntax. T
|
|
|
10
10
|
|
|
11
11
|
Other CSS properties (e.g. `opacity`, `transform`, `cursor`, `position`, `zIndex`) are passed through with standard Tasty value parsing but no special handler logic.
|
|
12
12
|
|
|
13
|
+
[`@tenphi/eslint-plugin-tasty`](getting-started.md#eslint-plugin) reports raw CSS properties that have a handler here (`prefer-shorthand-property`) and modifiers a property does not accept (`valid-directional-modifier`, `valid-radius-shape`).
|
|
14
|
+
|
|
13
15
|
---
|
|
14
16
|
|
|
15
17
|
## Recommended Props
|
|
@@ -20,9 +22,10 @@ Use these instead of their raw CSS counterparts:
|
|
|
20
22
|
|-----|------------|
|
|
21
23
|
| `fill` | `backgroundColor`, `background` |
|
|
22
24
|
| `image` | `backgroundImage` |
|
|
23
|
-
| `padding` (with direction modifiers) | `paddingTop`, `paddingRight`, `paddingBottom`, `paddingLeft` |
|
|
24
|
-
| `margin` (with direction modifiers) | `marginTop`, `marginRight`, `marginBottom`, `marginLeft` |
|
|
25
|
-
|
|
|
25
|
+
| `padding` (with physical direction modifiers) | `paddingTop`, `paddingRight`, `paddingBottom`, `paddingLeft` |
|
|
26
|
+
| `margin` (with physical direction modifiers) | `marginTop`, `marginRight`, `marginBottom`, `marginLeft` |
|
|
27
|
+
| Logical block/inline category styles (with `start`/`end` modifiers) | Native logical axis/edge declarations |
|
|
28
|
+
| `width` / `blockSize` / `inlineSize` (with `min`/`max` modifiers) | Their separate min/max declarations when one state map is sufficient |
|
|
26
29
|
| `height` (with `min`/`max` modifiers) | `minHeight`, `maxHeight` |
|
|
27
30
|
| `border` | `borderColor`, `borderWidth`, `borderStyle` |
|
|
28
31
|
| `radius` | `borderRadius` |
|
|
@@ -36,6 +39,24 @@ Use these instead of their raw CSS counterparts:
|
|
|
36
39
|
|
|
37
40
|
## Layout
|
|
38
41
|
|
|
42
|
+
### `overscrollBehavior`
|
|
43
|
+
|
|
44
|
+
The native `overscrollBehavior` shorthand and its `overscrollBehaviorBlock`,
|
|
45
|
+
`overscrollBehaviorInline`, `overscrollBehaviorX`, and `overscrollBehaviorY`
|
|
46
|
+
longhands support `auto`, `contain`, `none`, and `chain`. The shorthand can set
|
|
47
|
+
separate X and Y values, for example `overscrollBehavior: 'chain contain'`.
|
|
48
|
+
|
|
49
|
+
`chain` allows scroll chaining to another scrollable area while suppressing
|
|
50
|
+
boundary effects such as bounce. It requires browser support; use a feature
|
|
51
|
+
query and a fallback floor when targeting browsers without it:
|
|
52
|
+
|
|
53
|
+
```jsx
|
|
54
|
+
overscrollBehaviorBlock: {
|
|
55
|
+
_: 'auto',
|
|
56
|
+
'@supports(overscroll-behavior-block: chain)': 'chain',
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
39
60
|
### `display`
|
|
40
61
|
|
|
41
62
|
Standard CSS display values. Handled together with `hide`, `textOverflow`, `overflow`, and `whiteSpace` for priority resolution.
|
|
@@ -45,7 +66,7 @@ Standard CSS display values. Handled together with `hide`, `textOverflow`, `over
|
|
|
45
66
|
| `display` | Any CSS display value | Overridden by `hide` or multi-line `textOverflow` |
|
|
46
67
|
| `hide` | `true` / `false` | Shortcut for `display: none`. Highest priority |
|
|
47
68
|
| `overflow` | Any CSS overflow value | Overridden when `textOverflow` sets `hidden` |
|
|
48
|
-
| `whiteSpace` | Any CSS white-space value |
|
|
69
|
+
| `whiteSpace` | Any CSS white-space value | Explicit value wins over the `nowrap` / `initial` that `textOverflow` sets |
|
|
49
70
|
|
|
50
71
|
### `textOverflow`
|
|
51
72
|
|
|
@@ -59,7 +80,7 @@ Text truncation with optional multi-line clamping.
|
|
|
59
80
|
| `"ellipsis / 3"` | Multi-line clamp (3 lines) with ellipsis, sets `overflow: hidden` and `white-space: initial` |
|
|
60
81
|
| `"clip"` | Single-line truncation without ellipsis, sets `overflow: hidden` and `white-space: nowrap` |
|
|
61
82
|
| `"clip / 2"` | Multi-line clip (2 lines), sets `overflow: hidden` and `white-space: initial` |
|
|
62
|
-
| `
|
|
83
|
+
| `"initial"` | Reset text-overflow to initial |
|
|
63
84
|
|
|
64
85
|
Explicit `whiteSpace` overrides the default white-space set by `textOverflow`.
|
|
65
86
|
|
|
@@ -125,9 +146,9 @@ A group that names *no* direction keeps plain CSS shorthand order, which is unam
|
|
|
125
146
|
|
|
126
147
|
Later comma-separated groups override earlier groups for conflicting directions.
|
|
127
148
|
|
|
128
|
-
|
|
149
|
+
A group with directions but no value (`padding: 'top'`) uses `1x`, the same as `padding: true`, so it follows `configure({ units })`.
|
|
129
150
|
|
|
130
|
-
|
|
151
|
+
Individual physical props `paddingTop`, `paddingRight`, `paddingBottom`, and `paddingLeft` are supported, but `padding` with modifiers is recommended. Use `blockPadding` or `inlinePadding` for an enhanced logical-axis shorthand; native declarations such as `paddingInlineStart` remain ordinary CSS properties. See [Logical properties](#logical-properties).
|
|
131
152
|
|
|
132
153
|
### `margin`
|
|
133
154
|
|
|
@@ -153,9 +174,7 @@ The [one-value-per-directional-group rule](#padding) from `padding` applies here
|
|
|
153
174
|
|
|
154
175
|
Later comma-separated groups override earlier groups for conflicting directions.
|
|
155
176
|
|
|
156
|
-
Individual props `marginTop`, `marginRight`, `marginBottom`, `marginLeft
|
|
157
|
-
|
|
158
|
-
**Priority:** `margin` < `marginBlock`/`marginInline` < `marginTop`/`marginRight`/`marginBottom`/`marginLeft`
|
|
177
|
+
Individual physical props `marginTop`, `marginRight`, `marginBottom`, and `marginLeft` are supported, but `margin` with modifiers is recommended. Use `blockMargin` or `inlineMargin` for an enhanced logical-axis shorthand; native declarations such as `marginInlineStart` remain ordinary CSS properties. See [Logical properties](#logical-properties).
|
|
159
178
|
|
|
160
179
|
### `width`
|
|
161
180
|
|
|
@@ -178,12 +197,15 @@ Element width with min/max control. One, two, or three values set `min-width`, `
|
|
|
178
197
|
| `"min 2x"` | `2x` | auto | initial |
|
|
179
198
|
| `"max 100%"` | initial | auto | `100%` |
|
|
180
199
|
| `"fixed 200px"` | `200px` | `200px` | `200px` |
|
|
200
|
+
| `"min"` | `1x` | auto | initial |
|
|
201
|
+
| `"max"` | initial | auto | `100%` |
|
|
202
|
+
| `"fixed"` | `max-content` | `max-content` | `max-content` |
|
|
181
203
|
|
|
182
204
|
**Keywords:** `stretch`, `max-content`, `min-content`, `fit-content`
|
|
183
205
|
|
|
184
206
|
| Value | Effect |
|
|
185
207
|
|-------|--------|
|
|
186
|
-
| `"stretch"` | Fill available space
|
|
208
|
+
| `"stretch"` | Fill the available space, margins included. Emitted with `-webkit-fill-available` and `-moz-available` fallbacks for engines without the standard keyword |
|
|
187
209
|
| `true` | Reset to `auto` / `initial` / `initial` |
|
|
188
210
|
| Number | Converted to `px` |
|
|
189
211
|
|
|
@@ -191,7 +213,7 @@ Separate `minWidth` and `maxWidth` props are supported and override values from
|
|
|
191
213
|
|
|
192
214
|
### `height`
|
|
193
215
|
|
|
194
|
-
Element height. Same syntax, modifiers, and positional patterns as `width`.
|
|
216
|
+
Element height. Same syntax, modifiers, keywords, and positional patterns as `width`, including `stretch`.
|
|
195
217
|
|
|
196
218
|
Separate `minHeight` and `maxHeight` props are supported and override values from the `height` syntax.
|
|
197
219
|
|
|
@@ -234,9 +256,44 @@ second to every side they span.
|
|
|
234
256
|
|
|
235
257
|
Later comma-separated groups override earlier groups for conflicting directions.
|
|
236
258
|
|
|
237
|
-
Individual props `top`, `right`, `bottom`, `left
|
|
259
|
+
Individual physical props `top`, `right`, `bottom`, and `left` are supported. When only those props are used (without `inset`), individual CSS properties are output for correct cascade behavior with state overrides. Use `blockInset` or `inlineInset` for logical axes; native declarations such as `insetInlineStart` remain ordinary CSS properties.
|
|
260
|
+
|
|
261
|
+
### Logical properties
|
|
262
|
+
|
|
263
|
+
Tasty provides one enhanced handler for each logical axis/category pair. Each handler emits native logical CSS instead of converting values to `top`, `right`, `bottom`, `left`, `width`, or `height`. The browser therefore resolves `block`, `inline`, `start`, and `end` from the element's `writingMode` and `direction`.
|
|
264
|
+
|
|
265
|
+
```jsx
|
|
266
|
+
styles: {
|
|
267
|
+
direction: 'rtl',
|
|
268
|
+
inlinePadding: '1x start, 2x end',
|
|
269
|
+
inlineBorder: '1bw solid #accent start',
|
|
270
|
+
blockInset: '0 end',
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
An axis handler accepts one value for both edges or two values in logical **start/end** order. Use `start` and `end` modifiers, with comma-separated groups for different edge values. Unspecified padding, margin, and scroll edges reset to `0`; unspecified inset edges reset to `auto`. The `longhand` modifier emits the two native start/end declarations.
|
|
275
|
+
|
|
276
|
+
| Category | Block axis | Inline axis |
|
|
277
|
+
|----------|------------|-------------|
|
|
278
|
+
| Size | `blockSize` | `inlineSize` |
|
|
279
|
+
| Padding | `blockPadding` | `inlinePadding` |
|
|
280
|
+
| Margin | `blockMargin` | `inlineMargin` |
|
|
281
|
+
| Inset | `blockInset` | `inlineInset` |
|
|
282
|
+
| Scroll margin | `blockScrollMargin` | `inlineScrollMargin` |
|
|
283
|
+
| Scroll padding | `blockScrollPadding` | `inlineScrollPadding` |
|
|
284
|
+
| Border | `blockBorder` | `inlineBorder` |
|
|
238
285
|
|
|
239
|
-
|
|
286
|
+
`blockSize` and `inlineSize` use the same enhanced one/two/three-value and `min`/`max`/`fixed` syntax as `width`. Separate `minBlockSize`, `maxBlockSize`, `minInlineSize`, and `maxInlineSize` declarations override constraints produced by that shorthand.
|
|
287
|
+
|
|
288
|
+
`blockBorder` and `inlineBorder` use the same width/style/color parsing and defaults as `border`, including `1bw`, color tokens, and `true`. Logical padding, margin, scroll margin, and scroll padding default to `1x` for `true`; logical inset defaults to `0`.
|
|
289
|
+
|
|
290
|
+
Native logical CSS names—such as `paddingInlineStart`, `borderBlockColor`, and `borderStartStartRadius`—remain available as ordinary CSS properties. They support Tasty tokens and units through the normal value parser, but do not get category defaults or directional shorthand behavior.
|
|
291
|
+
|
|
292
|
+
The physical `scrollMargin` and `scrollPadding` shorthands support the same values and physical direction modifiers as `padding`. Their logical counterparts stay in separate axis handlers.
|
|
293
|
+
|
|
294
|
+
`writingMode`, `direction`, and `textOrientation` are standard CSS control properties. They use Tasty's normal value parser and need no special handler.
|
|
295
|
+
|
|
296
|
+
Avoid setting physical and logical declarations that resolve to the same edge in one style block. Tasty keeps them separate and lets the native CSS cascade resolve the overlap, whose result also depends on writing mode and direction.
|
|
240
297
|
|
|
241
298
|
---
|
|
242
299
|
|
|
@@ -255,9 +312,10 @@ Background color with design token support. Preferred over `backgroundColor` and
|
|
|
255
312
|
| `"#surface #primary.10"` | Background `#surface` with `#primary.10` overlay (two colors enable smooth transitions between both) |
|
|
256
313
|
| `"rgb(255 128 0)"` | CSS color value |
|
|
257
314
|
| `"color-mix(in oklab, #primary 50%, #surface)"` | CSS color function — see [CSS Color Functions](dsl.md#css-color-functions) |
|
|
258
|
-
| `true` | Default fill color |
|
|
259
315
|
|
|
260
|
-
When two colors are provided, the first sets the background color and the second is applied as an overlay gradient layer. This enables independent CSS transitions on each color.
|
|
316
|
+
When two colors are provided, the first sets the background color and the second is applied as an overlay gradient layer. This enables independent CSS transitions on each color. With `image` or `backgroundImage` on the same element, the image is layered over the overlay color in one `background-image`.
|
|
317
|
+
|
|
318
|
+
There is no default fill color, so `fill: true` is ignored with a development warning. Use `false` for no fill.
|
|
261
319
|
|
|
262
320
|
**Related deprecated props:** `backgroundColor` (use `fill`), `background` (overrides all background props when set — avoid).
|
|
263
321
|
|
|
@@ -288,6 +346,7 @@ Text color with design token support.
|
|
|
288
346
|
| `"#current.5"` | Current inherited color at 50% opacity |
|
|
289
347
|
| `"(#primary, #secondary)"` | Fallback: use `#primary`, fall back to `#secondary` |
|
|
290
348
|
| `"light-dark(#dark, #light)"` | CSS color function — see [CSS Color Functions](dsl.md#css-color-functions) |
|
|
349
|
+
| `"#ddd"` | Hex literal, read as the `#ddd` token with the literal as fallback: `var(--ddd-color, #ddd)`, as in every color style |
|
|
291
350
|
| `true` | `currentColor` |
|
|
292
351
|
|
|
293
352
|
Also sets `$current-color` to the same color, for anything that needs the
|
|
@@ -318,7 +377,7 @@ Border shorthand with directional and multi-group support. Use **comma-separated
|
|
|
318
377
|
|
|
319
378
|
**Syntax:** `[width] [style] [color] [directions...]` — comma-separated for multiple groups
|
|
320
379
|
|
|
321
|
-
**Defaults:** width = `1bw`, style = `solid`, color = `#border`
|
|
380
|
+
**Defaults:** width = `1bw`, style = `solid`, color = `#border`, which is the text color (`currentColor`) until your tokens define `#border`
|
|
322
381
|
|
|
323
382
|
**Styles:** `none`, `hidden`, `dotted`, `dashed`, `solid`, `double`, `groove`, `ridge`, `inset`, `outset`
|
|
324
383
|
|
|
@@ -338,6 +397,8 @@ Border shorthand with directional and multi-group support. Use **comma-separated
|
|
|
338
397
|
|
|
339
398
|
Later comma-separated groups override earlier groups for conflicting directions.
|
|
340
399
|
|
|
400
|
+
A directional group without a width (`'dotted left'`) uses `1bw`, the same as `border: true`, so it follows `configure({ units })`.
|
|
401
|
+
|
|
341
402
|
### `radius`
|
|
342
403
|
|
|
343
404
|
Border radius with shape presets and directional modifiers.
|
|
@@ -377,13 +438,15 @@ Use these when an edge modifier would round one corner too many. Edge and corner
|
|
|
377
438
|
| `"4px top-left"` | Top-left corner `4px`, every other corner `0` |
|
|
378
439
|
| `"top bottom-right"` | Both top corners and bottom-right `1r`, bottom-left `0` |
|
|
379
440
|
|
|
441
|
+
A value-less corner group (`'top-right'`, `'top bottom-right'`) uses `1r`, the same as `radius: true`, so it follows `configure({ units })`.
|
|
442
|
+
|
|
380
443
|
### `outline`
|
|
381
444
|
|
|
382
445
|
Outline with inline offset support.
|
|
383
446
|
|
|
384
447
|
**Syntax:** `[width] [style] [color] / [offset]`
|
|
385
448
|
|
|
386
|
-
**Defaults:** width = `1ow`, style = `solid`, color = `#outline`
|
|
449
|
+
**Defaults:** width = `1ow`, style = `solid`, color = `#outline`, which is the text color (`currentColor`) until your tokens define `#outline`
|
|
387
450
|
|
|
388
451
|
**Styles:** Same as `border` (`none`, `dotted`, `dashed`, `solid`, etc.)
|
|
389
452
|
|
|
@@ -418,7 +481,7 @@ Multiple shadows: `shadow="1x 1x 2x #dark.20, inset 0 0 4x #dark.10"`
|
|
|
418
481
|
|
|
419
482
|
### `preset`
|
|
420
483
|
|
|
421
|
-
Typography preset that sets font-size, line-height, letter-spacing, font-weight, font-style,
|
|
484
|
+
Typography preset that sets font-size, line-height, letter-spacing, font-weight, font-style, text-transform, and font-family (unless `font` or `fontFamily` is set) from named design tokens. It also sets the `--bold-font-weight` and `--icon-size` variables that `strong` and `icon` read.
|
|
422
485
|
|
|
423
486
|
**Syntax:** `name`, `name / modifier...`, or `modifier...` (shorthand)
|
|
424
487
|
|
|
@@ -430,10 +493,11 @@ Use `/` to separate the preset name from one or more space-separated modifiers.
|
|
|
430
493
|
|
|
431
494
|
| Modifier | Effect |
|
|
432
495
|
|----------|--------|
|
|
433
|
-
| `strong` (or `bold`) | Sets `font-weight` to bold (from `$bold-font-weight` token) |
|
|
496
|
+
| `strong` (or `bold`) | Sets `font-weight` to bold (from `$bold-font-weight` token, `700` until your tokens define it) |
|
|
434
497
|
| `italic` | Sets `font-style: italic` |
|
|
435
498
|
| `icon` | Sets font-size and line-height to icon size |
|
|
436
499
|
| `tight` | Sets line-height equal to font-size |
|
|
500
|
+
| `normal` | Sets `line-height: normal` |
|
|
437
501
|
|
|
438
502
|
```jsx
|
|
439
503
|
preset="h1" // heading 1
|
|
@@ -453,9 +517,9 @@ Font family with design-system fallback. Preferred over `fontFamily`.
|
|
|
453
517
|
|
|
454
518
|
| Value | Effect |
|
|
455
519
|
|-------|--------|
|
|
456
|
-
| `"monospace"` | Monospace
|
|
457
|
-
| `true` | Default
|
|
458
|
-
| `"CustomFont"` | Custom font
|
|
520
|
+
| `"monospace"` | Monospace stack from `$font-mono`, falling back to the built-in `$font-mono-fallback` |
|
|
521
|
+
| `true` | Default sans stack from `$font-sans`, falling back to `$font-sans-fallback` |
|
|
522
|
+
| `"CustomFont"` | Custom font followed by the `$font-sans` stack |
|
|
459
523
|
|
|
460
524
|
`fontFamily` is supported as a direct pass-through without fallback logic.
|
|
461
525
|
|
|
@@ -531,18 +595,22 @@ When easing is provided without a duration, the default timing variable is used
|
|
|
531
595
|
| `width` | `width`, `min-width`, `max-width` |
|
|
532
596
|
| `height` | `height`, `min-height`, `max-height` |
|
|
533
597
|
| `gap` | `gap`, `margin` |
|
|
534
|
-
| `zIndex` | `z-index` |
|
|
598
|
+
| `zIndex` | `z-index` (same as writing `z-index`) |
|
|
535
599
|
| `inset` | `inset`, `top`, `right`, `bottom`, `left` |
|
|
536
600
|
|
|
537
|
-
|
|
601
|
+
Any other name passes through as a CSS property.
|
|
602
|
+
|
|
603
|
+
When two entries cover the same property, an entry that names that one property wins over a group such as `theme`, in either order: `opacity 120ms ease-in-out, theme` keeps the opacity timing. Otherwise the later entry wins, as in CSS.
|
|
604
|
+
|
|
605
|
+
Default timing: `$transition` (or `${name}-transition` with `$transition` fallback per semantic name). `$transition` is `80ms` until your tokens define it. Prefer omitting the duration or using a duration token instead of repeating raw time values across components. Explicit zero can disable motion.
|
|
538
606
|
|
|
539
607
|
```jsx
|
|
540
|
-
transition="theme
|
|
541
|
-
transition="fill
|
|
542
|
-
transition="fade
|
|
608
|
+
transition="theme"
|
|
609
|
+
transition="fill, radius"
|
|
610
|
+
transition="fade $transition ease-in"
|
|
543
611
|
transition="fill ease-in" // easing without duration (uses default timing)
|
|
544
612
|
transition="radius ease-in-out" // easing keyword only
|
|
545
|
-
transition="$$custom-prop
|
|
613
|
+
transition="$$custom-prop" // custom property transition
|
|
546
614
|
```
|
|
547
615
|
|
|
548
616
|
**Recognized easing keywords:** `ease`, `ease-in`, `ease-out`, `ease-in-out`, `linear`, `step-start`, `step-end`. CSS easing functions (`cubic-bezier(...)`, `steps(...)`, `linear(...)`) are also recognized.
|
|
@@ -551,6 +619,24 @@ If the name is not a semantic name, it is used as a literal CSS property name.
|
|
|
551
619
|
|
|
552
620
|
---
|
|
553
621
|
|
|
622
|
+
### `animation`
|
|
623
|
+
|
|
624
|
+
`animation` is the native CSS shorthand. Tasty parses tokens in its value and
|
|
625
|
+
tracks local `@keyframes` names referenced by it, so it needs no custom style
|
|
626
|
+
handler. Define a complete animation with the shorthand, using a configured
|
|
627
|
+
duration token where appropriate (for example,
|
|
628
|
+
`animation: 'pulse $animation-duration ease-in infinite'`).
|
|
629
|
+
|
|
630
|
+
Use `animationDuration`, `animationTimeline`, `animationRange`, and other CSS
|
|
631
|
+
longhands when changing just one part of an existing animation in a state or
|
|
632
|
+
component extension. Setting `animation` resets omitted parts, including its
|
|
633
|
+
timeline and range. The same principle applies to `transitionDuration` and
|
|
634
|
+
other transition longhands when a base `transition` is already defined.
|
|
635
|
+
`transitionBehavior` remains a separate CSS longhand; Tasty's semantic
|
|
636
|
+
`transition` syntax covers name, timing, easing, and delay.
|
|
637
|
+
|
|
638
|
+
---
|
|
639
|
+
|
|
554
640
|
## Scrollbar & Overflow
|
|
555
641
|
|
|
556
642
|
### `scrollbar`
|
|
@@ -604,11 +690,11 @@ plain CSS shorthand order, like `padding`. See the [`padding` rule](#padding).
|
|
|
604
690
|
|
|
605
691
|
| Value | Effect |
|
|
606
692
|
|-------|--------|
|
|
607
|
-
| `"top"` | Fade top edge, default width
|
|
693
|
+
| `"top"` | Fade top edge, default width `2x`, all other edges unfaded |
|
|
608
694
|
| `"2x left right"` | Fade left and right edges with `2x` width, top/bottom unfaded |
|
|
609
695
|
| `"3x 1x"` | All edges faded — top/bottom `3x`, left/right `1x` (CSS shorthand order) |
|
|
610
696
|
| `"3x top, 1x bottom"` | Fade top with `3x` width, bottom with `1x` width |
|
|
611
|
-
| `"2x #
|
|
697
|
+
| `"2x #clear #dark"` | All edges faded with `2x` width, from `#clear` to `#dark` |
|
|
612
698
|
| `"top #a #b, bottom #c #d"` | Top fades from `#a` to `#b`, bottom fades from `#c` to `#d` |
|
|
613
699
|
|
|
614
700
|
Colors are optional: first = transparent mask start, second = opaque mask end.
|