@tenphi/tasty 0.0.0-snapshot.bbd10c7 → 0.0.0-snapshot.bbfcd75
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 +196 -140
- package/dist/babel-Zs1Q03qt.d.ts +83 -0
- package/dist/chunks/async-storage-CG5HnUT5.js +20 -0
- package/dist/chunks/async-storage-CG5HnUT5.js.map +1 -0
- package/dist/chunks/build-config-CUQVwdWF.js +42 -0
- package/dist/chunks/build-config-CUQVwdWF.js.map +1 -0
- package/dist/chunks/collector-B0LTHw6Z.js +208 -0
- package/dist/chunks/collector-B0LTHw6Z.js.map +1 -0
- package/dist/chunks/config-engine-C3pF9EK9.js +267 -0
- package/dist/chunks/config-engine-C3pF9EK9.js.map +1 -0
- package/dist/chunks/css-definitions-D_it4XZH.js +875 -0
- package/dist/chunks/css-definitions-D_it4XZH.js.map +1 -0
- package/dist/chunks/css-resources-BN8apgxt.js +142 -0
- package/dist/chunks/css-resources-BN8apgxt.js.map +1 -0
- package/dist/{debug.js → chunks/debug-C9LeNVoJ.js} +187 -139
- package/dist/chunks/debug-C9LeNVoJ.js.map +1 -0
- package/dist/chunks/dsl-C5yuAn41.js +1373 -0
- package/dist/chunks/dsl-C5yuAn41.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-O-OUrKLH.js +557 -0
- package/dist/chunks/react-runtime-O-OUrKLH.js.map +1 -0
- package/dist/chunks/runtime-engine-DvnE2g-E.js +2437 -0
- package/dist/chunks/runtime-engine-DvnE2g-E.js.map +1 -0
- package/dist/chunks/runtime-state-BTDqSYBk.js +127 -0
- package/dist/chunks/runtime-state-BTDqSYBk.js.map +1 -0
- package/dist/{utils/merge-styles.js → chunks/shared-utils-DWA4LjIa.js} +55 -55
- package/dist/chunks/shared-utils-DWA4LjIa.js.map +1 -0
- package/dist/chunks/style-engine-C1ECBZxR.js +5131 -0
- package/dist/chunks/style-engine-C1ECBZxR.js.map +1 -0
- package/dist/{zero/extractor.js → chunks/zero-engine-B6EnYcXY.js} +89 -82
- package/dist/chunks/zero-engine-B6EnYcXY.js.map +1 -0
- package/dist/collector-hl5KNH7k.d.ts +165 -0
- package/dist/config-DWL1ZYue.d.ts +1358 -0
- package/dist/core/index.d.ts +5 -34
- package/dist/core/index.js +9 -27
- package/dist/index-D9N9GV24.d.ts +1947 -0
- package/dist/index.d.ts +5 -51
- package/dist/index.js +11 -36
- package/dist/{utils/merge-styles.d.ts → merge-styles-C_oMoJVd.d.ts} +3 -3
- package/dist/ssr/astro-client.js +6 -0
- package/dist/ssr/astro-client.js.map +1 -0
- package/dist/ssr/astro-middleware-extract-static.d.ts +11 -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 +11 -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 +18 -0
- package/dist/ssr/astro-middleware-static.js +7 -0
- package/dist/ssr/astro-middleware-static.js.map +1 -0
- package/dist/ssr/astro-middleware.d.ts +19 -0
- package/dist/ssr/astro-middleware.js +7 -0
- package/dist/ssr/astro-middleware.js.map +1 -0
- package/dist/ssr/astro.d.ts +117 -11
- package/dist/ssr/astro.js +204 -48
- package/dist/ssr/astro.js.map +1 -1
- package/dist/ssr/index.d.ts +37 -4
- package/dist/ssr/index.js +6 -6
- package/dist/ssr/index.js.map +1 -1
- package/dist/ssr/next-config.d.ts +66 -0
- package/dist/ssr/next-config.js +124 -0
- package/dist/ssr/next-config.js.map +1 -0
- package/dist/ssr/next.d.ts +14 -5
- package/dist/ssr/next.js +31 -46
- package/dist/ssr/next.js.map +1 -1
- package/dist/static/index.d.ts +91 -5
- package/dist/static/index.js +31 -3
- package/dist/static/index.js.map +1 -0
- package/dist/static/inject.js.map +1 -1
- package/dist/types-jKZNpias.d.ts +1616 -0
- package/dist/zero/babel.d.ts +2 -182
- package/dist/zero/babel.js +82 -113
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/index.d.ts +81 -3
- package/dist/zero/index.js +2 -3
- package/dist/zero/next.d.ts +1 -1
- package/dist/zero/next.js +0 -31
- package/dist/zero/next.js.map +1 -1
- package/docs/README.md +20 -12
- package/docs/adoption.md +59 -32
- package/docs/ai-agents.md +229 -0
- package/docs/comparison.md +76 -48
- package/docs/configuration.md +566 -69
- package/docs/debug.md +37 -23
- package/docs/design-system.md +63 -32
- package/docs/dsl.md +527 -179
- package/docs/getting-started.md +62 -41
- package/docs/injector.md +157 -51
- package/docs/methodology.md +69 -37
- package/docs/migration-v3.md +285 -0
- package/docs/pipeline.md +744 -0
- package/docs/plugins.md +353 -0
- package/docs/{runtime.md → react-api.md} +176 -67
- package/docs/runtime-benchmarks.md +377 -0
- package/docs/ssr.md +350 -94
- package/docs/styles.md +108 -27
- package/docs/tasty-static.md +149 -87
- package/package.json +121 -23
- package/tasty.config.ts +6 -0
- package/dist/_virtual/_rolldown/runtime.js +0 -7
- package/dist/chunks/cacheKey.js +0 -77
- package/dist/chunks/cacheKey.js.map +0 -1
- package/dist/chunks/definitions.d.ts +0 -37
- package/dist/chunks/definitions.js +0 -258
- package/dist/chunks/definitions.js.map +0 -1
- package/dist/chunks/index.d.ts +0 -1
- package/dist/chunks/renderChunk.d.ts +0 -1
- package/dist/chunks/renderChunk.js +0 -59
- package/dist/chunks/renderChunk.js.map +0 -1
- package/dist/compute-styles.d.ts +0 -31
- package/dist/compute-styles.js +0 -356
- package/dist/compute-styles.js.map +0 -1
- package/dist/config.d.ts +0 -372
- package/dist/config.js +0 -507
- package/dist/config.js.map +0 -1
- package/dist/counter-style/index.js +0 -51
- package/dist/counter-style/index.js.map +0 -1
- package/dist/debug.d.ts +0 -89
- package/dist/debug.js.map +0 -1
- package/dist/font-face/index.js +0 -63
- package/dist/font-face/index.js.map +0 -1
- package/dist/hooks/index.d.ts +0 -7
- package/dist/hooks/useCounterStyle.d.ts +0 -50
- package/dist/hooks/useCounterStyle.js +0 -45
- package/dist/hooks/useCounterStyle.js.map +0 -1
- package/dist/hooks/useFontFace.d.ts +0 -43
- package/dist/hooks/useFontFace.js +0 -69
- package/dist/hooks/useFontFace.js.map +0 -1
- package/dist/hooks/useGlobalStyles.d.ts +0 -30
- package/dist/hooks/useGlobalStyles.js +0 -77
- package/dist/hooks/useGlobalStyles.js.map +0 -1
- package/dist/hooks/useKeyframes.d.ts +0 -56
- package/dist/hooks/useKeyframes.js +0 -63
- package/dist/hooks/useKeyframes.js.map +0 -1
- package/dist/hooks/useProperty.d.ts +0 -79
- package/dist/hooks/useProperty.js +0 -108
- package/dist/hooks/useProperty.js.map +0 -1
- package/dist/hooks/useRawCSS.d.ts +0 -53
- package/dist/hooks/useRawCSS.js +0 -34
- package/dist/hooks/useRawCSS.js.map +0 -1
- package/dist/hooks/useStyles.d.ts +0 -40
- package/dist/hooks/useStyles.js +0 -29
- package/dist/hooks/useStyles.js.map +0 -1
- package/dist/injector/index.d.ts +0 -166
- package/dist/injector/index.js +0 -166
- package/dist/injector/index.js.map +0 -1
- package/dist/injector/injector.d.ts +0 -166
- package/dist/injector/injector.js +0 -464
- package/dist/injector/injector.js.map +0 -1
- package/dist/injector/sheet-manager.d.ts +0 -136
- package/dist/injector/sheet-manager.js +0 -733
- package/dist/injector/sheet-manager.js.map +0 -1
- package/dist/injector/types.d.ts +0 -204
- package/dist/keyframes/index.js +0 -206
- package/dist/keyframes/index.js.map +0 -1
- package/dist/parser/classify.js +0 -319
- package/dist/parser/classify.js.map +0 -1
- package/dist/parser/const.js +0 -60
- package/dist/parser/const.js.map +0 -1
- package/dist/parser/lru.js +0 -109
- package/dist/parser/lru.js.map +0 -1
- package/dist/parser/parser.d.ts +0 -25
- package/dist/parser/parser.js +0 -115
- package/dist/parser/parser.js.map +0 -1
- package/dist/parser/tokenizer.js +0 -69
- package/dist/parser/tokenizer.js.map +0 -1
- package/dist/parser/types.d.ts +0 -51
- package/dist/parser/types.js +0 -46
- package/dist/parser/types.js.map +0 -1
- package/dist/pipeline/conditions.d.ts +0 -134
- package/dist/pipeline/conditions.js +0 -406
- package/dist/pipeline/conditions.js.map +0 -1
- package/dist/pipeline/exclusive.js +0 -230
- package/dist/pipeline/exclusive.js.map +0 -1
- package/dist/pipeline/index.d.ts +0 -55
- package/dist/pipeline/index.js +0 -708
- package/dist/pipeline/index.js.map +0 -1
- package/dist/pipeline/materialize.js +0 -1103
- package/dist/pipeline/materialize.js.map +0 -1
- package/dist/pipeline/parseStateKey.d.ts +0 -15
- package/dist/pipeline/parseStateKey.js +0 -446
- package/dist/pipeline/parseStateKey.js.map +0 -1
- package/dist/pipeline/simplify.js +0 -515
- package/dist/pipeline/simplify.js.map +0 -1
- package/dist/pipeline/warnings.js +0 -18
- package/dist/pipeline/warnings.js.map +0 -1
- package/dist/plugins/index.d.ts +0 -2
- package/dist/plugins/okhsl-plugin.d.ts +0 -35
- package/dist/plugins/okhsl-plugin.js +0 -97
- package/dist/plugins/okhsl-plugin.js.map +0 -1
- package/dist/plugins/types.d.ts +0 -76
- package/dist/properties/index.js +0 -222
- package/dist/properties/index.js.map +0 -1
- package/dist/properties/property-type-resolver.d.ts +0 -24
- package/dist/properties/property-type-resolver.js +0 -90
- package/dist/properties/property-type-resolver.js.map +0 -1
- package/dist/ssr/async-storage.d.ts +0 -17
- package/dist/ssr/async-storage.js +0 -34
- package/dist/ssr/async-storage.js.map +0 -1
- package/dist/ssr/collect-auto-properties.js +0 -39
- package/dist/ssr/collect-auto-properties.js.map +0 -1
- package/dist/ssr/collector.d.ts +0 -102
- package/dist/ssr/collector.js +0 -219
- package/dist/ssr/collector.js.map +0 -1
- package/dist/ssr/format-global-rules.js +0 -22
- package/dist/ssr/format-global-rules.js.map +0 -1
- package/dist/ssr/format-keyframes.js +0 -69
- package/dist/ssr/format-keyframes.js.map +0 -1
- package/dist/ssr/format-property.js +0 -49
- package/dist/ssr/format-property.js.map +0 -1
- package/dist/ssr/format-rules.js +0 -73
- package/dist/ssr/format-rules.js.map +0 -1
- package/dist/ssr/hydrate.d.ts +0 -22
- package/dist/ssr/hydrate.js +0 -49
- package/dist/ssr/hydrate.js.map +0 -1
- package/dist/ssr/ssr-collector-ref.js +0 -12
- package/dist/ssr/ssr-collector-ref.js.map +0 -1
- package/dist/states/index.d.ts +0 -49
- package/dist/states/index.js +0 -170
- package/dist/states/index.js.map +0 -1
- package/dist/static/tastyStatic.d.ts +0 -46
- package/dist/static/tastyStatic.js +0 -30
- package/dist/static/tastyStatic.js.map +0 -1
- package/dist/static/types.d.ts +0 -49
- package/dist/static/types.js +0 -24
- package/dist/static/types.js.map +0 -1
- package/dist/styles/border.d.ts +0 -25
- package/dist/styles/border.js +0 -120
- package/dist/styles/border.js.map +0 -1
- package/dist/styles/color.d.ts +0 -14
- package/dist/styles/color.js +0 -26
- package/dist/styles/color.js.map +0 -1
- package/dist/styles/const.js +0 -17
- package/dist/styles/const.js.map +0 -1
- package/dist/styles/createStyle.js +0 -79
- package/dist/styles/createStyle.js.map +0 -1
- package/dist/styles/dimension.js +0 -109
- package/dist/styles/dimension.js.map +0 -1
- package/dist/styles/directional.js +0 -133
- package/dist/styles/directional.js.map +0 -1
- package/dist/styles/display.d.ts +0 -30
- package/dist/styles/display.js +0 -73
- package/dist/styles/display.js.map +0 -1
- package/dist/styles/fade.d.ts +0 -15
- package/dist/styles/fade.js +0 -62
- package/dist/styles/fade.js.map +0 -1
- package/dist/styles/fill.d.ts +0 -42
- package/dist/styles/fill.js +0 -51
- package/dist/styles/fill.js.map +0 -1
- package/dist/styles/flow.d.ts +0 -16
- package/dist/styles/flow.js +0 -12
- package/dist/styles/flow.js.map +0 -1
- package/dist/styles/gap.d.ts +0 -31
- package/dist/styles/gap.js +0 -38
- package/dist/styles/gap.js.map +0 -1
- package/dist/styles/height.d.ts +0 -17
- package/dist/styles/height.js +0 -19
- package/dist/styles/height.js.map +0 -1
- package/dist/styles/index.d.ts +0 -1
- package/dist/styles/index.js +0 -8
- package/dist/styles/index.js.map +0 -1
- package/dist/styles/inset.d.ts +0 -24
- package/dist/styles/inset.js +0 -34
- package/dist/styles/inset.js.map +0 -1
- package/dist/styles/list.d.ts +0 -16
- package/dist/styles/list.js +0 -100
- package/dist/styles/list.js.map +0 -1
- package/dist/styles/margin.d.ts +0 -24
- package/dist/styles/margin.js +0 -32
- package/dist/styles/margin.js.map +0 -1
- package/dist/styles/outline.d.ts +0 -29
- package/dist/styles/outline.js +0 -55
- package/dist/styles/outline.js.map +0 -1
- package/dist/styles/padding.d.ts +0 -24
- package/dist/styles/padding.js +0 -32
- package/dist/styles/padding.js.map +0 -1
- package/dist/styles/placement.d.ts +0 -37
- package/dist/styles/placement.js +0 -74
- package/dist/styles/placement.js.map +0 -1
- package/dist/styles/predefined.d.ts +0 -71
- package/dist/styles/predefined.js +0 -237
- package/dist/styles/predefined.js.map +0 -1
- package/dist/styles/preset.d.ts +0 -52
- package/dist/styles/preset.js +0 -127
- package/dist/styles/preset.js.map +0 -1
- package/dist/styles/radius.d.ts +0 -12
- package/dist/styles/radius.js +0 -83
- package/dist/styles/radius.js.map +0 -1
- package/dist/styles/scrollMargin.d.ts +0 -24
- package/dist/styles/scrollMargin.js +0 -32
- package/dist/styles/scrollMargin.js.map +0 -1
- package/dist/styles/scrollbar.d.ts +0 -25
- package/dist/styles/scrollbar.js +0 -51
- package/dist/styles/scrollbar.js.map +0 -1
- package/dist/styles/shadow.d.ts +0 -14
- package/dist/styles/shadow.js +0 -25
- package/dist/styles/shadow.js.map +0 -1
- package/dist/styles/shared.js +0 -17
- package/dist/styles/shared.js.map +0 -1
- package/dist/styles/transition.d.ts +0 -14
- package/dist/styles/transition.js +0 -159
- package/dist/styles/transition.js.map +0 -1
- package/dist/styles/types.d.ts +0 -564
- package/dist/styles/width.d.ts +0 -17
- package/dist/styles/width.js +0 -19
- package/dist/styles/width.js.map +0 -1
- package/dist/tasty.d.ts +0 -134
- package/dist/tasty.js +0 -240
- package/dist/tasty.js.map +0 -1
- package/dist/types.d.ts +0 -184
- package/dist/utils/cache-wrapper.js +0 -21
- package/dist/utils/cache-wrapper.js.map +0 -1
- package/dist/utils/case-converter.js +0 -8
- package/dist/utils/case-converter.js.map +0 -1
- package/dist/utils/color-math.d.ts +0 -46
- package/dist/utils/color-math.js +0 -749
- package/dist/utils/color-math.js.map +0 -1
- package/dist/utils/color-space.d.ts +0 -5
- package/dist/utils/color-space.js +0 -228
- package/dist/utils/color-space.js.map +0 -1
- package/dist/utils/colors.d.ts +0 -5
- package/dist/utils/colors.js +0 -10
- package/dist/utils/colors.js.map +0 -1
- package/dist/utils/css-types.d.ts +0 -7
- package/dist/utils/dotize.d.ts +0 -26
- package/dist/utils/dotize.js +0 -122
- package/dist/utils/dotize.js.map +0 -1
- package/dist/utils/filter-base-props.d.ts +0 -15
- package/dist/utils/filter-base-props.js +0 -45
- package/dist/utils/filter-base-props.js.map +0 -1
- package/dist/utils/get-display-name.d.ts +0 -7
- package/dist/utils/get-display-name.js +0 -10
- package/dist/utils/get-display-name.js.map +0 -1
- package/dist/utils/has-keys.js +0 -13
- package/dist/utils/has-keys.js.map +0 -1
- package/dist/utils/is-dev-env.js +0 -19
- package/dist/utils/is-dev-env.js.map +0 -1
- package/dist/utils/is-valid-element-type.js +0 -15
- package/dist/utils/is-valid-element-type.js.map +0 -1
- package/dist/utils/merge-styles.js.map +0 -1
- package/dist/utils/mod-attrs.d.ts +0 -6
- package/dist/utils/mod-attrs.js +0 -20
- package/dist/utils/mod-attrs.js.map +0 -1
- package/dist/utils/process-tokens.d.ts +0 -17
- package/dist/utils/process-tokens.js +0 -83
- package/dist/utils/process-tokens.js.map +0 -1
- package/dist/utils/resolve-recipes.d.ts +0 -17
- package/dist/utils/resolve-recipes.js +0 -146
- package/dist/utils/resolve-recipes.js.map +0 -1
- package/dist/utils/selector-transform.js +0 -32
- package/dist/utils/selector-transform.js.map +0 -1
- package/dist/utils/string.js +0 -8
- package/dist/utils/string.js.map +0 -1
- package/dist/utils/styles.d.ts +0 -99
- package/dist/utils/styles.js +0 -220
- package/dist/utils/styles.js.map +0 -1
- package/dist/utils/typography.d.ts +0 -47
- package/dist/utils/typography.js +0 -51
- package/dist/utils/typography.js.map +0 -1
- package/dist/utils/warnings.d.ts +0 -16
- package/dist/utils/warnings.js +0 -16
- package/dist/utils/warnings.js.map +0 -1
- package/dist/zero/css-writer.d.ts +0 -45
- package/dist/zero/css-writer.js +0 -73
- package/dist/zero/css-writer.js.map +0 -1
- package/dist/zero/extractor.d.ts +0 -24
- package/dist/zero/extractor.js.map +0 -1
- package/docs/PIPELINE.md +0 -519
- /package/dist/{chunks/cacheKey.d.ts → ssr/astro-client.d.ts} +0 -0
package/docs/styles.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Style Properties Reference
|
|
2
2
|
|
|
3
|
-
All standard CSS properties are supported in Tasty and benefit from its syntax sugar: design tokens (`$name`, `#name`), custom units (`2x`, `1r`, `1bw`), color opacity (`#purple.5`), auto-calc (`(100% - 2x)`), and custom functions. Values are parsed through the Tasty engine automatically.
|
|
3
|
+
All standard CSS properties are supported in Tasty and benefit from its syntax sugar: design tokens (`$name`, `#name`), custom units (`2x`, `1r`, `1bw`), color opacity (`#purple.5`), auto-calc (`(100% - 2x)`), and [custom functions](dsl.md#functions-function) (`$$negative(10px)`). Values are parsed through the Tasty engine automatically.
|
|
4
4
|
|
|
5
5
|
The properties documented below have **custom handlers** with enhanced syntax. They should be **preferred** over their raw CSS equivalents because they:
|
|
6
6
|
|
|
@@ -20,9 +20,10 @@ Use these instead of their raw CSS counterparts:
|
|
|
20
20
|
|-----|------------|
|
|
21
21
|
| `fill` | `backgroundColor`, `background` |
|
|
22
22
|
| `image` | `backgroundImage` |
|
|
23
|
-
| `padding` (with direction modifiers) | `paddingTop`, `paddingRight`, `paddingBottom`, `paddingLeft` |
|
|
24
|
-
| `margin` (with direction modifiers) | `marginTop`, `marginRight`, `marginBottom`, `marginLeft` |
|
|
25
|
-
|
|
|
23
|
+
| `padding` (with physical direction modifiers) | `paddingTop`, `paddingRight`, `paddingBottom`, `paddingLeft` |
|
|
24
|
+
| `margin` (with physical direction modifiers) | `marginTop`, `marginRight`, `marginBottom`, `marginLeft` |
|
|
25
|
+
| Logical block/inline category styles (with `start`/`end` modifiers) | Native logical axis/edge declarations |
|
|
26
|
+
| `width` / `blockSize` / `inlineSize` (with `min`/`max` modifiers) | Their separate min/max declarations when one state map is sufficient |
|
|
26
27
|
| `height` (with `min`/`max` modifiers) | `minHeight`, `maxHeight` |
|
|
27
28
|
| `border` | `borderColor`, `borderWidth`, `borderStyle` |
|
|
28
29
|
| `radius` | `borderRadius` |
|
|
@@ -100,18 +101,23 @@ For flex/grid layouts, outputs native `gap`. For block layouts, emulates gap usi
|
|
|
100
101
|
|
|
101
102
|
Element padding with directional modifiers and multi-group support. Use **comma-separated groups** to set a base value and then override specific directions.
|
|
102
103
|
|
|
103
|
-
**Syntax:** `[value]` | `[
|
|
104
|
+
**Syntax:** `[value]` | `[block inline]` | `[top right bottom left]` | `[value direction...]` — comma-separated for multiple groups
|
|
104
105
|
|
|
105
106
|
**Direction modifiers:** `top`, `right`, `bottom`, `left`
|
|
106
107
|
|
|
107
108
|
**Output modifier:** `longhand` — forces output as individual CSS longhand properties (`padding-top`, `padding-right`, `padding-bottom`, `padding-left`) instead of the `padding` shorthand. Useful when children need to selectively inherit individual directions.
|
|
108
109
|
|
|
110
|
+
**One value per directional group.** A group that names direction modifiers takes **exactly one** value, applied to every direction it names. For different values per side, use comma-separated groups: `padding: '2x top, 4x right'`. Writing `padding: '2x 4x top right'` ignores `4x` and warns in development — the parser keeps values and modifiers in separate buckets, so their interleaving in the source is not recoverable and `'2x 4x top right'`, `'2x top 4x right'` and `'top 2x right 4x'` are all the same input.
|
|
111
|
+
|
|
112
|
+
A group that names *no* direction keeps plain CSS shorthand order, which is unambiguous and unchanged.
|
|
113
|
+
|
|
109
114
|
| Value | Effect |
|
|
110
115
|
|-------|--------|
|
|
111
116
|
| `"2x"` | All sides `2x` |
|
|
112
117
|
| `"2x 1x"` | Top/bottom `2x`, left/right `1x` |
|
|
113
118
|
| `"2x top"` | Top `2x`, right/bottom/left `0` |
|
|
114
119
|
| `"1x left right"` | Left and right `1x`, top/bottom `0` |
|
|
120
|
+
| `"2x top, 4x right"` | Top `2x`, right `4x`, bottom/left `0` |
|
|
115
121
|
| `"1x, 2x top"` | All sides `1x`, then top overridden to `2x` |
|
|
116
122
|
| `"1x, 2x top bottom"` | Left/right `1x`, top/bottom `2x` |
|
|
117
123
|
| `"2x longhand"` | All sides `2x`, output as 4 individual `padding-*` properties |
|
|
@@ -120,34 +126,33 @@ Element padding with directional modifiers and multi-group support. Use **comma-
|
|
|
120
126
|
|
|
121
127
|
Later comma-separated groups override earlier groups for conflicting directions.
|
|
122
128
|
|
|
123
|
-
Individual props `paddingTop`, `paddingRight`, `paddingBottom`, `paddingLeft
|
|
124
|
-
|
|
125
|
-
**Priority:** `padding` < `paddingBlock`/`paddingInline` < `paddingTop`/`paddingRight`/`paddingBottom`/`paddingLeft`
|
|
129
|
+
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).
|
|
126
130
|
|
|
127
131
|
### `margin`
|
|
128
132
|
|
|
129
133
|
Element margin. Same syntax, modifiers, and multi-group support as `padding`.
|
|
130
134
|
|
|
131
|
-
**Syntax:** `[value]` | `[
|
|
135
|
+
**Syntax:** `[value]` | `[block inline]` | `[top right bottom left]` | `[value direction...]` — comma-separated for multiple groups
|
|
132
136
|
|
|
133
137
|
**Direction modifiers:** `top`, `right`, `bottom`, `left`
|
|
134
138
|
|
|
135
139
|
**Output modifier:** `longhand` — forces output as individual CSS longhand properties (`margin-top`, etc.) instead of the `margin` shorthand.
|
|
136
140
|
|
|
141
|
+
The [one-value-per-directional-group rule](#padding) from `padding` applies here too.
|
|
142
|
+
|
|
137
143
|
| Value | Effect |
|
|
138
144
|
|-------|--------|
|
|
139
145
|
| `"2x"` | All sides `2x` |
|
|
140
146
|
| `"2x 1x"` | Top/bottom `2x`, left/right `1x` |
|
|
141
147
|
| `"2x top"` | Top `2x`, right/bottom/left `0` |
|
|
148
|
+
| `"2x top, 4x right"` | Top `2x`, right `4x`, bottom/left `0` |
|
|
142
149
|
| `"auto left right, 1x top bottom"` | Left/right `auto`, top/bottom `1x` |
|
|
143
150
|
| `true` | All sides `1x` |
|
|
144
151
|
| Number | Converted to `px` |
|
|
145
152
|
|
|
146
153
|
Later comma-separated groups override earlier groups for conflicting directions.
|
|
147
154
|
|
|
148
|
-
Individual props `marginTop`, `marginRight`, `marginBottom`, `marginLeft
|
|
149
|
-
|
|
150
|
-
**Priority:** `margin` < `marginBlock`/`marginInline` < `marginTop`/`marginRight`/`marginBottom`/`marginLeft`
|
|
155
|
+
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).
|
|
151
156
|
|
|
152
157
|
### `width`
|
|
153
158
|
|
|
@@ -191,10 +196,23 @@ Separate `minHeight` and `maxHeight` props are supported and override values fro
|
|
|
191
196
|
|
|
192
197
|
Positioning offsets with directional modifiers and multi-group support. Same directional syntax as `padding`.
|
|
193
198
|
|
|
194
|
-
**Syntax:** `[value]` | `[
|
|
199
|
+
**Syntax:** `[value]` | `[block inline]` | `[top right bottom left]` | `[value direction...]` — comma-separated for multiple groups
|
|
195
200
|
|
|
196
201
|
**Direction modifiers:** `top`, `right`, `bottom`, `left`
|
|
197
202
|
|
|
203
|
+
The [one-value-per-directional-group rule](#padding) from `padding` applies here too, with `dock`
|
|
204
|
+
as the single exception.
|
|
205
|
+
|
|
206
|
+
**`dock` modifier:** pins the named edge and spans its full length, by also applying the value
|
|
207
|
+
to the two perpendicular sides. `inset: 'bottom dock'` gives `inset: auto 0 0 0` — anchored to
|
|
208
|
+
the bottom, full width. Without a direction, `dock` fills every side.
|
|
209
|
+
|
|
210
|
+
`dock` is the one place a directional group takes **two** values: the first insets the named
|
|
211
|
+
edge, the second the sides it spans. `inset: '2x 4x bottom dock'` pins the bottom at `2x` and
|
|
212
|
+
insets the sides by `4x`. A third value, or a second value without `dock`, is ignored and warns
|
|
213
|
+
in development. With several directions the first value applies to each named edge and the
|
|
214
|
+
second to every side they span.
|
|
215
|
+
|
|
198
216
|
**Output modifier:** `longhand` — forces output as individual CSS properties (`top`, `right`, `bottom`, `left`) instead of the `inset` shorthand.
|
|
199
217
|
|
|
200
218
|
| Value | Effect |
|
|
@@ -205,12 +223,52 @@ Positioning offsets with directional modifiers and multi-group support. Same dir
|
|
|
205
223
|
| `"0, 2x top"` | All sides `0`, then top overridden to `2x` |
|
|
206
224
|
| `"0 longhand"` | All sides `0`, output as individual `top`/`right`/`bottom`/`left` |
|
|
207
225
|
| `true` | All sides `0` |
|
|
226
|
+
| `"bottom dock"` | Bottom/left/right `0`, top `auto` — bottom-anchored, full width |
|
|
227
|
+
| `"right dock"` | Right/top/bottom `0`, left `auto` — right-anchored, full height |
|
|
228
|
+
| `"2x bottom dock"` | Bottom/left/right `2x`, top `auto` |
|
|
229
|
+
| `"2x 4x bottom dock"` | Bottom `2x`, left/right `4x`, top `auto` |
|
|
230
|
+
| `"dock"` | All sides `0` |
|
|
208
231
|
|
|
209
232
|
Later comma-separated groups override earlier groups for conflicting directions.
|
|
210
233
|
|
|
211
|
-
Individual props `top`, `right`, `bottom`, `left
|
|
234
|
+
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.
|
|
235
|
+
|
|
236
|
+
### Logical properties
|
|
237
|
+
|
|
238
|
+
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`.
|
|
239
|
+
|
|
240
|
+
```jsx
|
|
241
|
+
styles: {
|
|
242
|
+
direction: 'rtl',
|
|
243
|
+
inlinePadding: '1x start, 2x end',
|
|
244
|
+
inlineBorder: '1bw solid #accent start',
|
|
245
|
+
blockInset: '0 end',
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
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.
|
|
250
|
+
|
|
251
|
+
| Category | Block axis | Inline axis |
|
|
252
|
+
|----------|------------|-------------|
|
|
253
|
+
| Size | `blockSize` | `inlineSize` |
|
|
254
|
+
| Padding | `blockPadding` | `inlinePadding` |
|
|
255
|
+
| Margin | `blockMargin` | `inlineMargin` |
|
|
256
|
+
| Inset | `blockInset` | `inlineInset` |
|
|
257
|
+
| Scroll margin | `blockScrollMargin` | `inlineScrollMargin` |
|
|
258
|
+
| Scroll padding | `blockScrollPadding` | `inlineScrollPadding` |
|
|
259
|
+
| Border | `blockBorder` | `inlineBorder` |
|
|
260
|
+
|
|
261
|
+
`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.
|
|
262
|
+
|
|
263
|
+
`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`.
|
|
212
264
|
|
|
213
|
-
|
|
265
|
+
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.
|
|
266
|
+
|
|
267
|
+
The physical `scrollMargin` and `scrollPadding` shorthands support the same values and physical direction modifiers as `padding`. Their logical counterparts stay in separate axis handlers.
|
|
268
|
+
|
|
269
|
+
`writingMode`, `direction`, and `textOrientation` are standard CSS control properties. They use Tasty's normal value parser and need no special handler.
|
|
270
|
+
|
|
271
|
+
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.
|
|
214
272
|
|
|
215
273
|
---
|
|
216
274
|
|
|
@@ -228,6 +286,7 @@ Background color with design token support. Preferred over `backgroundColor` and
|
|
|
228
286
|
| `"#purple.10"` | Token color at 10% opacity |
|
|
229
287
|
| `"#surface #primary.10"` | Background `#surface` with `#primary.10` overlay (two colors enable smooth transitions between both) |
|
|
230
288
|
| `"rgb(255 128 0)"` | CSS color value |
|
|
289
|
+
| `"color-mix(in oklab, #primary 50%, #surface)"` | CSS color function — see [CSS Color Functions](dsl.md#css-color-functions) |
|
|
231
290
|
| `true` | Default fill color |
|
|
232
291
|
|
|
233
292
|
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. The overlay is only applied when no explicit `image` or `backgroundImage` is set.
|
|
@@ -260,9 +319,17 @@ Text color with design token support.
|
|
|
260
319
|
| `"#current"` | Current inherited color |
|
|
261
320
|
| `"#current.5"` | Current inherited color at 50% opacity |
|
|
262
321
|
| `"(#primary, #secondary)"` | Fallback: use `#primary`, fall back to `#secondary` |
|
|
322
|
+
| `"light-dark(#dark, #light)"` | CSS color function — see [CSS Color Functions](dsl.md#css-color-functions) |
|
|
263
323
|
| `true` | `currentColor` |
|
|
264
324
|
|
|
265
|
-
|
|
325
|
+
Also sets `$current-color` to the same color, for anything that needs the
|
|
326
|
+
inherited color as a color rather than as the `currentcolor` keyword. Every color
|
|
327
|
+
publishes it, not just a named token, so a reader below always takes the nearest
|
|
328
|
+
`color` rather than the nearest *token* color. A value that already reads the
|
|
329
|
+
inherited color — `#current` itself, a `#current` fade, a bare `currentColor` —
|
|
330
|
+
is not republished: resolving it a second time one level down would fade it
|
|
331
|
+
twice, and the variable into itself is a self-reference. `#current` does not go
|
|
332
|
+
through it; it is the keyword.
|
|
266
333
|
|
|
267
334
|
### `svgFill`
|
|
268
335
|
|
|
@@ -270,7 +337,7 @@ SVG fill color. Same color token syntax as `fill` and `color`. Outputs the nativ
|
|
|
270
337
|
|
|
271
338
|
```jsx
|
|
272
339
|
svgFill="#purple.10"
|
|
273
|
-
svgFill="
|
|
340
|
+
svgFill="#current"
|
|
274
341
|
```
|
|
275
342
|
|
|
276
343
|
---
|
|
@@ -319,7 +386,11 @@ Border radius with shape presets and directional modifiers.
|
|
|
319
386
|
| `"backleaf"` | Asymmetric: round, sharp, round, sharp |
|
|
320
387
|
| `"inherit"` | Inherit border-radius from parent |
|
|
321
388
|
|
|
322
|
-
**
|
|
389
|
+
**Edge modifiers:** `top`, `right`, `bottom`, `left` — rounds the *pair* of corners along that edge.
|
|
390
|
+
|
|
391
|
+
**Corner modifiers:** `top-left`, `top-right`, `bottom-right`, `bottom-left` — rounds a single corner.
|
|
392
|
+
Use these when an edge modifier would round one corner too many. Edge and corner modifiers combine
|
|
393
|
+
(`radius: 'top bottom-right'`).
|
|
323
394
|
|
|
324
395
|
**Output modifier:** `longhand` — forces output as individual CSS longhand properties (`border-top-left-radius`, `border-top-right-radius`, `border-bottom-right-radius`, `border-bottom-left-radius`) instead of the `border-radius` shorthand. Useful when children need to selectively inherit individual corners via `radius: 'inherit left'`.
|
|
325
396
|
|
|
@@ -334,6 +405,9 @@ Border radius with shape presets and directional modifiers.
|
|
|
334
405
|
| `"1r longhand"` | All corners `1r`, output as 4 individual `border-*-radius` properties |
|
|
335
406
|
| `"inherit"` | All corners inherit from parent (`border-radius: inherit`) |
|
|
336
407
|
| `"inherit right"` | Right corners inherit from parent (uses longhand properties) |
|
|
408
|
+
| `"top-right"` | Top-right corner `1r`, every other corner `0` |
|
|
409
|
+
| `"4px top-left"` | Top-left corner `4px`, every other corner `0` |
|
|
410
|
+
| `"top bottom-right"` | Both top corners and bottom-right `1r`, bottom-left `0` |
|
|
337
411
|
|
|
338
412
|
### `outline`
|
|
339
413
|
|
|
@@ -378,11 +452,11 @@ Multiple shadows: `shadow="1x 1x 2x #dark.20, inset 0 0 4x #dark.10"`
|
|
|
378
452
|
|
|
379
453
|
Typography preset that sets font-size, line-height, letter-spacing, font-weight, font-style, and text-transform from named design tokens.
|
|
380
454
|
|
|
381
|
-
**Syntax:** `name`, `name / modifier
|
|
455
|
+
**Syntax:** `name`, `name / modifier...`, or `modifier...` (shorthand)
|
|
382
456
|
|
|
383
457
|
Preset names are project-specific (e.g. `h1`–`h6`, `t1`–`t4`, `p1`–`p4`). Register them for autocomplete by augmenting `TastyPresetNames`.
|
|
384
458
|
|
|
385
|
-
Use `/` to separate the preset name from
|
|
459
|
+
Use `/` to separate the preset name from one or more space-separated modifiers. When modifiers are used alone (without a name), the preset name defaults to `inherit`. Modifiers can be combined freely because they target different properties.
|
|
386
460
|
|
|
387
461
|
**Modifiers:**
|
|
388
462
|
|
|
@@ -394,11 +468,13 @@ Use `/` to separate the preset name from a modifier. When a modifier is used alo
|
|
|
394
468
|
| `tight` | Sets line-height equal to font-size |
|
|
395
469
|
|
|
396
470
|
```jsx
|
|
397
|
-
preset="h1"
|
|
398
|
-
preset="h2 / strong"
|
|
399
|
-
preset="
|
|
400
|
-
preset="
|
|
401
|
-
preset="
|
|
471
|
+
preset="h1" // heading 1
|
|
472
|
+
preset="h2 / strong" // bold heading 2
|
|
473
|
+
preset="h2 / strong italic" // bold + italic heading 2
|
|
474
|
+
preset="t3 / italic" // italic text 3
|
|
475
|
+
preset="t2 / strong tight" // bold text 2 with tight line-height
|
|
476
|
+
preset="bold" // inherit preset with bold (shorthand)
|
|
477
|
+
preset="bold italic" // inherit preset with bold + italic (shorthand)
|
|
402
478
|
```
|
|
403
479
|
|
|
404
480
|
Individual typography props (`fontSize`, `lineHeight`, `letterSpacing`, `fontWeight`, `fontStyle`, `textTransform`) can be used alongside `preset` to override specific values, but using `preset` alone is recommended.
|
|
@@ -550,15 +626,20 @@ Scrollbar styling using CSS standard properties (`scrollbar-width`, `scrollbar-c
|
|
|
550
626
|
|
|
551
627
|
Gradient-based edge fading using CSS masks. Use **comma-separated groups** to set different widths and colors per direction.
|
|
552
628
|
|
|
553
|
-
**Syntax:** `[width] [
|
|
629
|
+
**Syntax:** `[width] [direction...] [#from-color] [#to-color]` — comma-separated for multiple groups
|
|
554
630
|
|
|
555
631
|
**Direction modifiers:** `top`, `right`, `bottom`, `left`
|
|
556
632
|
|
|
633
|
+
A group that names edges takes a **single** width, applied to every edge it names — different
|
|
634
|
+
widths per edge come from comma groups. A group that names no edge covers all four and keeps
|
|
635
|
+
plain CSS shorthand order, like `padding`. See the [`padding` rule](#padding).
|
|
636
|
+
|
|
557
637
|
| Value | Effect |
|
|
558
638
|
|-------|--------|
|
|
559
639
|
| `"top"` | Fade top edge, default width (`2x`), all other edges unfaded |
|
|
560
640
|
| `"2x left right"` | Fade left and right edges with `2x` width, top/bottom unfaded |
|
|
561
|
-
| `"3x 1x
|
|
641
|
+
| `"3x 1x"` | All edges faded — top/bottom `3x`, left/right `1x` (CSS shorthand order) |
|
|
642
|
+
| `"3x top, 1x bottom"` | Fade top with `3x` width, bottom with `1x` width |
|
|
562
643
|
| `"2x #transparent #dark"` | All edges faded with `2x` width, from `#transparent` to `#dark` |
|
|
563
644
|
| `"top #a #b, bottom #c #d"` | Top fades from `#a` to `#b`, bottom fades from `#c` to `#d` |
|
|
564
645
|
|