@tenphi/tasty 0.0.0-snapshot.fafcbfe → 0.0.0-snapshot.fdb16ea
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 +397 -185
- package/dist/async-storage-DKK-wTD4.js +44 -0
- package/dist/async-storage-DKK-wTD4.js.map +1 -0
- package/dist/babel-CMYf4JZ2.d.ts +83 -0
- package/dist/collector-Ctn5s74s.d.ts +145 -0
- package/dist/collector-DMSR6ANK.js +304 -0
- package/dist/collector-DMSR6ANK.js.map +1 -0
- package/dist/config-B23gZrfP.js +12317 -0
- package/dist/config-B23gZrfP.js.map +1 -0
- package/dist/config-CZx8_DCu.d.ts +1296 -0
- package/dist/context-CA8YKeMn.js +24 -0
- package/dist/context-CA8YKeMn.js.map +1 -0
- package/dist/core/index.d.ts +5 -33
- package/dist/core/index.js +6 -26
- package/dist/core-B1tyn69d.js +1573 -0
- package/dist/core-B1tyn69d.js.map +1 -0
- package/dist/css-writer-CvAxkR6S.js +390 -0
- package/dist/css-writer-CvAxkR6S.js.map +1 -0
- package/dist/format-global-rules-DklyaXv-.js +22 -0
- package/dist/format-global-rules-DklyaXv-.js.map +1 -0
- package/dist/format-rules-BCTWVvcS.js +130 -0
- package/dist/format-rules-BCTWVvcS.js.map +1 -0
- package/dist/hydrate-BCPvkJj3.js +37 -0
- package/dist/hydrate-BCPvkJj3.js.map +1 -0
- package/dist/index-B3o0aCYV.d.ts +1538 -0
- package/dist/index-CsvB0EXZ.d.ts +1909 -0
- package/dist/index.d.ts +5 -40
- package/dist/index.js +921 -32
- package/dist/index.js.map +1 -0
- package/dist/keyframes-Dxdx3KOo.js +493 -0
- package/dist/keyframes-Dxdx3KOo.js.map +1 -0
- package/dist/{utils/merge-styles.js → merge-styles-C-uwpoNW.js} +4 -6
- package/dist/merge-styles-C-uwpoNW.js.map +1 -0
- package/dist/{utils/merge-styles.d.ts → merge-styles-DJTSfz_M.d.ts} +3 -3
- package/dist/{utils/resolve-recipes.js → resolve-recipes-BuOvSEa2.js} +5 -8
- package/dist/resolve-recipes-BuOvSEa2.js.map +1 -0
- package/dist/ssr/astro-client.d.ts +1 -0
- package/dist/ssr/astro-client.js +19 -0
- package/dist/ssr/astro-client.js.map +1 -0
- package/dist/ssr/astro-middleware-static.d.ts +16 -0
- package/dist/ssr/astro-middleware-static.js +18 -0
- package/dist/ssr/astro-middleware-static.js.map +1 -0
- package/dist/ssr/astro-middleware.d.ts +17 -0
- package/dist/ssr/astro-middleware.js +19 -0
- package/dist/ssr/astro-middleware.js.map +1 -0
- package/dist/ssr/astro.d.ts +93 -0
- package/dist/ssr/astro.js +157 -0
- package/dist/ssr/astro.js.map +1 -0
- package/dist/ssr/index.d.ts +37 -0
- package/dist/ssr/index.js +10 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/next.d.ts +45 -0
- package/dist/ssr/next.js +74 -0
- package/dist/ssr/next.js.map +1 -0
- package/dist/static/index.d.ts +91 -5
- package/dist/static/index.js +49 -4
- package/dist/static/index.js.map +1 -0
- package/dist/static/inject.d.ts +5 -0
- package/dist/static/inject.js +17 -0
- package/dist/static/inject.js.map +1 -0
- package/dist/zero/babel.d.ts +2 -108
- package/dist/zero/babel.js +235 -39
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/index.d.ts +81 -3
- package/dist/zero/index.js +2 -4
- package/dist/zero/next.d.ts +56 -30
- package/dist/zero/next.js +106 -41
- package/dist/zero/next.js.map +1 -1
- package/docs/README.md +39 -0
- package/docs/adoption.md +323 -0
- package/docs/ai-agents.md +224 -0
- package/docs/comparison.md +448 -0
- package/docs/configuration.md +823 -0
- package/docs/debug.md +322 -0
- package/docs/design-system.md +455 -0
- package/docs/dsl.md +1021 -0
- package/docs/getting-started.md +238 -0
- package/docs/injector.md +614 -0
- package/docs/methodology.md +648 -0
- package/docs/migration-v3.md +285 -0
- package/docs/pipeline.md +741 -0
- package/docs/plugins.md +353 -0
- package/docs/react-api.md +681 -0
- package/docs/runtime-benchmarks.md +216 -0
- package/docs/ssr.md +451 -0
- package/docs/styles.md +645 -0
- package/docs/tasty-static.md +582 -0
- package/package.json +149 -40
- package/tasty.config.ts +6 -0
- package/dist/_virtual/_rolldown/runtime.js +0 -8
- package/dist/chunks/cacheKey.js +0 -70
- package/dist/chunks/cacheKey.js.map +0 -1
- package/dist/chunks/definitions.d.ts +0 -37
- package/dist/chunks/definitions.js +0 -260
- package/dist/chunks/definitions.js.map +0 -1
- package/dist/chunks/renderChunk.js +0 -61
- package/dist/chunks/renderChunk.js.map +0 -1
- package/dist/config.d.ts +0 -280
- package/dist/config.js +0 -403
- package/dist/config.js.map +0 -1
- package/dist/debug.d.ts +0 -204
- package/dist/debug.js +0 -733
- package/dist/debug.js.map +0 -1
- package/dist/hooks/useGlobalStyles.d.ts +0 -27
- package/dist/hooks/useGlobalStyles.js +0 -56
- package/dist/hooks/useGlobalStyles.js.map +0 -1
- package/dist/hooks/useKeyframes.d.ts +0 -56
- package/dist/hooks/useKeyframes.js +0 -54
- package/dist/hooks/useKeyframes.js.map +0 -1
- package/dist/hooks/useProperty.d.ts +0 -79
- package/dist/hooks/useProperty.js +0 -91
- package/dist/hooks/useProperty.js.map +0 -1
- package/dist/hooks/useRawCSS.d.ts +0 -53
- package/dist/hooks/useRawCSS.js +0 -28
- package/dist/hooks/useRawCSS.js.map +0 -1
- package/dist/hooks/useStyles.d.ts +0 -40
- package/dist/hooks/useStyles.js +0 -169
- package/dist/hooks/useStyles.js.map +0 -1
- package/dist/injector/index.d.ts +0 -157
- package/dist/injector/index.js +0 -154
- package/dist/injector/index.js.map +0 -1
- package/dist/injector/injector.d.ts +0 -139
- package/dist/injector/injector.js +0 -404
- package/dist/injector/injector.js.map +0 -1
- package/dist/injector/sheet-manager.d.ts +0 -127
- package/dist/injector/sheet-manager.js +0 -714
- package/dist/injector/sheet-manager.js.map +0 -1
- package/dist/injector/types.d.ts +0 -135
- 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 -33
- 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 -116
- 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 -400
- package/dist/pipeline/conditions.js.map +0 -1
- package/dist/pipeline/exclusive.js +0 -231
- package/dist/pipeline/exclusive.js.map +0 -1
- package/dist/pipeline/index.d.ts +0 -53
- package/dist/pipeline/index.js +0 -641
- package/dist/pipeline/index.js.map +0 -1
- package/dist/pipeline/materialize.js +0 -908
- package/dist/pipeline/materialize.js.map +0 -1
- package/dist/pipeline/parseStateKey.d.ts +0 -15
- package/dist/pipeline/parseStateKey.js +0 -430
- package/dist/pipeline/parseStateKey.js.map +0 -1
- package/dist/pipeline/simplify.js +0 -557
- package/dist/pipeline/simplify.js.map +0 -1
- package/dist/plugins/okhsl-plugin.d.ts +0 -35
- package/dist/plugins/okhsl-plugin.js +0 -371
- package/dist/plugins/okhsl-plugin.js.map +0 -1
- package/dist/plugins/types.d.ts +0 -69
- package/dist/properties/index.js +0 -158
- package/dist/properties/index.js.map +0 -1
- package/dist/states/index.d.ts +0 -49
- package/dist/states/index.js +0 -416
- package/dist/states/index.js.map +0 -1
- package/dist/static/tastyStatic.d.ts +0 -46
- package/dist/static/tastyStatic.js +0 -31
- 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/align.d.ts +0 -15
- package/dist/styles/align.js +0 -14
- package/dist/styles/align.js.map +0 -1
- package/dist/styles/border.d.ts +0 -25
- package/dist/styles/border.js +0 -114
- package/dist/styles/border.js.map +0 -1
- package/dist/styles/color.d.ts +0 -14
- package/dist/styles/color.js +0 -23
- package/dist/styles/color.js.map +0 -1
- package/dist/styles/createStyle.js +0 -77
- package/dist/styles/createStyle.js.map +0 -1
- package/dist/styles/dimension.js +0 -97
- package/dist/styles/dimension.js.map +0 -1
- package/dist/styles/display.d.ts +0 -37
- package/dist/styles/display.js +0 -67
- package/dist/styles/display.js.map +0 -1
- package/dist/styles/fade.d.ts +0 -15
- package/dist/styles/fade.js +0 -58
- package/dist/styles/fade.js.map +0 -1
- package/dist/styles/fill.d.ts +0 -44
- 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 -37
- package/dist/styles/gap.js.map +0 -1
- package/dist/styles/height.d.ts +0 -17
- package/dist/styles/height.js +0 -20
- package/dist/styles/height.js.map +0 -1
- package/dist/styles/index.d.ts +0 -2
- package/dist/styles/index.js +0 -9
- package/dist/styles/index.js.map +0 -1
- package/dist/styles/inset.d.ts +0 -52
- package/dist/styles/inset.js +0 -150
- package/dist/styles/inset.js.map +0 -1
- package/dist/styles/justify.d.ts +0 -15
- package/dist/styles/justify.js +0 -14
- package/dist/styles/justify.js.map +0 -1
- package/dist/styles/list.d.ts +0 -16
- package/dist/styles/list.js +0 -98
- package/dist/styles/list.js.map +0 -1
- package/dist/styles/margin.d.ts +0 -24
- package/dist/styles/margin.js +0 -104
- package/dist/styles/margin.js.map +0 -1
- package/dist/styles/outline.d.ts +0 -29
- package/dist/styles/outline.js +0 -65
- package/dist/styles/outline.js.map +0 -1
- package/dist/styles/padding.d.ts +0 -24
- package/dist/styles/padding.js +0 -104
- package/dist/styles/padding.js.map +0 -1
- package/dist/styles/predefined.d.ts +0 -73
- package/dist/styles/predefined.js +0 -241
- package/dist/styles/predefined.js.map +0 -1
- package/dist/styles/preset.d.ts +0 -47
- package/dist/styles/preset.js +0 -126
- package/dist/styles/preset.js.map +0 -1
- package/dist/styles/radius.d.ts +0 -14
- package/dist/styles/radius.js +0 -51
- package/dist/styles/radius.js.map +0 -1
- package/dist/styles/scrollbar.d.ts +0 -21
- package/dist/styles/scrollbar.js +0 -105
- package/dist/styles/scrollbar.js.map +0 -1
- package/dist/styles/shadow.d.ts +0 -14
- package/dist/styles/shadow.js +0 -24
- package/dist/styles/shadow.js.map +0 -1
- package/dist/styles/styledScrollbar.d.ts +0 -47
- package/dist/styles/styledScrollbar.js +0 -38
- package/dist/styles/styledScrollbar.js.map +0 -1
- package/dist/styles/transition.d.ts +0 -14
- package/dist/styles/transition.js +0 -158
- package/dist/styles/transition.js.map +0 -1
- package/dist/styles/types.d.ts +0 -498
- package/dist/styles/width.d.ts +0 -17
- package/dist/styles/width.js +0 -20
- package/dist/styles/width.js.map +0 -1
- package/dist/tasty.d.ts +0 -982
- package/dist/tasty.js +0 -191
- package/dist/tasty.js.map +0 -1
- package/dist/tokens/typography.d.ts +0 -19
- package/dist/tokens/typography.js +0 -237
- package/dist/tokens/typography.js.map +0 -1
- package/dist/types.d.ts +0 -184
- package/dist/utils/cache-wrapper.js +0 -26
- 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/colors.d.ts +0 -5
- package/dist/utils/colors.js +0 -9
- 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/hsl-to-rgb.js +0 -38
- package/dist/utils/hsl-to-rgb.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 -8
- package/dist/utils/mod-attrs.js +0 -21
- package/dist/utils/mod-attrs.js.map +0 -1
- package/dist/utils/okhsl-to-rgb.js +0 -296
- package/dist/utils/okhsl-to-rgb.js.map +0 -1
- package/dist/utils/process-tokens.d.ts +0 -31
- package/dist/utils/process-tokens.js +0 -171
- package/dist/utils/process-tokens.js.map +0 -1
- package/dist/utils/resolve-recipes.d.ts +0 -17
- package/dist/utils/resolve-recipes.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 -183
- package/dist/utils/styles.js +0 -585
- package/dist/utils/styles.js.map +0 -1
- package/dist/utils/typography.d.ts +0 -36
- package/dist/utils/typography.js +0 -53
- 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 -74
- package/dist/zero/css-writer.js.map +0 -1
- package/dist/zero/extractor.d.ts +0 -24
- package/dist/zero/extractor.js +0 -150
- package/dist/zero/extractor.js.map +0 -1
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
# Migration Guide: v2 → v3
|
|
2
|
+
|
|
3
|
+
Everything that changes when you upgrade from `@tenphi/tasty` 2.x to 3.0, in the order you will hit it.
|
|
4
|
+
|
|
5
|
+
Most of the work is mechanical renames — see the [search-and-replace cheat sheet](#search-and-replace-cheat-sheet) at the end. The parts that need real attention are the [directional shorthand](#2-directional-shorthand) rule and the [behavior changes](#8-behavior-changes-that-are-not-renames).
|
|
6
|
+
|
|
7
|
+
- [At a glance](#at-a-glance)
|
|
8
|
+
- [1. Styles-object keys](#1-styles-object-keys)
|
|
9
|
+
- [2. Directional shorthand](#2-directional-shorthand)
|
|
10
|
+
- [3. Config keys](#3-config-keys)
|
|
11
|
+
- [4. Renamed exports](#4-renamed-exports)
|
|
12
|
+
- [5. Removed exports](#5-removed-exports)
|
|
13
|
+
- [6. Removed props](#6-removed-props)
|
|
14
|
+
- [7. Moved subpath](#7-moved-subpath)
|
|
15
|
+
- [8. Behavior changes that are not renames](#8-behavior-changes-that-are-not-renames)
|
|
16
|
+
- [9. New in v3](#9-new-in-v3)
|
|
17
|
+
- [Search-and-replace cheat sheet](#search-and-replace-cheat-sheet)
|
|
18
|
+
- [Not changed](#not-changed)
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## At a glance
|
|
23
|
+
|
|
24
|
+
| v2.11 | v3.0 | Find it with |
|
|
25
|
+
| ------------------------------- | --------------------------------- | ------------------------------ |
|
|
26
|
+
| `'@properties': { … }` | `'@property': { … }` | `rg "'@properties'"` |
|
|
27
|
+
| `'@fontFace': { … }` | `'@font-face': { … }` | `rg "'@fontFace'"` |
|
|
28
|
+
| `'@counterStyle': { … }` | `'@counter-style': { … }` | `rg "'@counterStyle'"` |
|
|
29
|
+
| `padding: '2x 4x top right'` | `padding: '2x top, 4x right'` | dev-mode console warning |
|
|
30
|
+
| `fade: '3x 1x top bottom'` | `fade: '3x top, 1x bottom'` | dev-mode console warning |
|
|
31
|
+
| `configure({ funcs })` | `configure({ functions })` | `rg "funcs"` |
|
|
32
|
+
| `configure({ fontFace })` | `configure({ fontFaces })` | `rg "fontFace:"` |
|
|
33
|
+
| `configure({ counterStyle })` | `configure({ counterStyles })` | `rg "counterStyle:"` |
|
|
34
|
+
| `getCssText()` | `getCSSText()` | `rg "getCssText"` |
|
|
35
|
+
| `getCssTextForNode()` | `getCSSTextForNode()` | `rg "getCssTextForNode"` |
|
|
36
|
+
| `getCssTextForClasses()` | `getCSSTextForClasses()` | `rg "getCssTextForClasses"` |
|
|
37
|
+
| `getGlobalFontFace()` | `getGlobalFontFaces()` | `rg "getGlobalFontFace\b"` |
|
|
38
|
+
| `getGlobalCounterStyle()` | `getGlobalCounterStyles()` | `rg "getGlobalCounterStyle\b"` |
|
|
39
|
+
| `getGlobalFunction()` | `getGlobalFunctions()` | `rg "getGlobalFunction\b"` |
|
|
40
|
+
| `okhslFunc` / `okhstFunc` | `okhslFunction` / `okhstFunction` | `rg "okhs[lt]Func\b"` |
|
|
41
|
+
| `CssOptions` | `CSSOptions` | `rg "CssOptions"` |
|
|
42
|
+
| `ParserOptions.funcs` | `ParserOptions.functions` | `rg "funcs:"` |
|
|
43
|
+
| `StyleParser#setFuncs()` | `StyleParser#setFunctions()` | `rg "setFuncs"` |
|
|
44
|
+
| `ChunkInfo` (from `tastyDebug`) | `DebugChunkInfo` | `rg "ChunkInfo"` |
|
|
45
|
+
| `@tenphi/tasty/next` | `@tenphi/tasty/zero/next` | `rg "tasty/next"` |
|
|
46
|
+
| `getIsTestEnvironment()` | `isTestEnvironment()` | `rg "getIsTestEnvironment"` |
|
|
47
|
+
| `hydrateTastyCache()` | `hydrateTastyClasses()` | `rg "hydrateTastyCache"` |
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 1. Styles-object keys
|
|
52
|
+
|
|
53
|
+
At-rule keys now match the real CSS at-rule names Tasty already emits, so they are kebab-case rather than camelCase. The generated CSS is unchanged.
|
|
54
|
+
|
|
55
|
+
```diff
|
|
56
|
+
const Card = tasty({
|
|
57
|
+
styles: {
|
|
58
|
+
- '@properties': { '$elevation': { syntax: '<number>' } },
|
|
59
|
+
- '@fontFace': { Inter: { src: 'url(/inter.woff2)' } },
|
|
60
|
+
- '@counterStyle': { dashes: { system: 'cyclic', symbols: '"—"' } },
|
|
61
|
+
+ '@property': { '$elevation': { syntax: '<number>' } },
|
|
62
|
+
+ '@font-face': { Inter: { src: 'url(/inter.woff2)' } },
|
|
63
|
+
+ '@counter-style': { dashes: { system: 'cyclic', symbols: '"—"' } },
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`@keyframes` and `@starting` are unchanged — they were already spec-faithful.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 2. Directional shorthand
|
|
73
|
+
|
|
74
|
+
**This is the one change that can alter rendered CSS without a rename.** A style group that names direction modifiers now takes a **single** value, applied to every direction it names.
|
|
75
|
+
|
|
76
|
+
The old form looked positional but never was: the parser buckets values and modifiers into separate arrays per comma group, so `'2x 4x top right'`, `'2x top 4x right'`, and `'top 2x right 4x'` were all the same input, and the pairing was decided by the order the _modifiers_ happened to appear in. `'1x 2x right top'` and `'1x 2x top right'` produced different CSS, and `'1x 2x top top'` silently assigned `top` twice.
|
|
77
|
+
|
|
78
|
+
Per-side values now come from comma-separated groups:
|
|
79
|
+
|
|
80
|
+
```diff
|
|
81
|
+
- padding: '2x 4x top right'
|
|
82
|
+
+ padding: '2x top, 4x right'
|
|
83
|
+
|
|
84
|
+
- margin: 'right 1x top 2x'
|
|
85
|
+
+ margin: '1x right, 2x top'
|
|
86
|
+
|
|
87
|
+
- inset: 'left 2x right 1x'
|
|
88
|
+
+ inset: '2x left, 1x right'
|
|
89
|
+
|
|
90
|
+
- fade: '3x 1x top bottom'
|
|
91
|
+
+ fade: '3x top, 1x bottom'
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Affects `padding`, `margin`, `inset`, `scrollMargin`, and `fade`. Extra values are ignored with a **development-mode warning** naming the offending value, so run your app in dev and watch the console — that is the reliable way to find every occurrence. Production is silent and never throws.
|
|
95
|
+
|
|
96
|
+
**Unchanged:** single-value directional groups (`padding: '2x top'`, `'1x left right'`), every value-only CSS shorthand form (`padding: '1x 2x'`, `'1x 2x 3x 4x'`, and `fade: '3x 1x'` — a group that names no direction is unambiguous and keeps plain shorthand order), CSS-wide keywords, and the `longhand` modifier.
|
|
97
|
+
|
|
98
|
+
`inset`'s `dock` modifier keeps its two-value form with sharper semantics: the first value applies to the named edge, the second to the perpendicular sides it spans, so `inset: '2x 4x bottom dock'` still gives `auto 32px 16px 32px`. A third value with `dock`, or a second value without it, now warns.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 3. Config keys
|
|
103
|
+
|
|
104
|
+
```diff
|
|
105
|
+
configure({
|
|
106
|
+
- funcs: { double: (groups) => `calc(2 * ${groups[0].output})` },
|
|
107
|
+
- fontFace: { Inter: { src: 'url(/inter.woff2)' } },
|
|
108
|
+
- counterStyle: { dashes: { system: 'cyclic', symbols: '"—"' } },
|
|
109
|
+
+ functions: { double: (groups) => `calc(2 * ${groups[0].output})` },
|
|
110
|
+
+ fontFaces: { Inter: { src: 'url(/inter.woff2)' } },
|
|
111
|
+
+ counterStyles: { dashes: { system: 'cyclic', symbols: '"—"' } },
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
`functions` is a single map holding both flavors, discriminated by value type:
|
|
116
|
+
|
|
117
|
+
- **bare key + function value** → a parse-time function, called as `name(...)`
|
|
118
|
+
- **`$$name` key + object value** → a declarative CSS `@function`, called as `$$name(...)`
|
|
119
|
+
|
|
120
|
+
A key whose prefix doesn't match its value type is ignored with a development warning.
|
|
121
|
+
|
|
122
|
+
> If you are coming from a pre-release build of v3, note the intermediate `function` config key never shipped. Upgraders from 2.x only ever wrote `funcs`.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## 4. Renamed exports
|
|
127
|
+
|
|
128
|
+
**Raw-CSS family** — aligned on the `CSS` initialism already used by `useRawCSS` / `injectRawCSS` / `getRawCSSText`:
|
|
129
|
+
|
|
130
|
+
- `getCssText()` → `getCSSText()`
|
|
131
|
+
- `getCssTextForNode()` → `getCSSTextForNode()`
|
|
132
|
+
- `StyleInjector#getCssTextForClasses()` → `getCSSTextForClasses()`
|
|
133
|
+
- `CssOptions` → `CSSOptions`
|
|
134
|
+
|
|
135
|
+
**Config getters** — pluralized to match their already-plural config keys:
|
|
136
|
+
|
|
137
|
+
- `getGlobalFontFace()` → `getGlobalFontFaces()`
|
|
138
|
+
- `getGlobalCounterStyle()` → `getGlobalCounterStyles()`
|
|
139
|
+
- `getGlobalFunction()` → `getGlobalFunctions()`
|
|
140
|
+
|
|
141
|
+
**Color functions** — aligned with the `useFunction` / `FunctionDefinition` family:
|
|
142
|
+
|
|
143
|
+
- `okhslFunc` → `okhslFunction`
|
|
144
|
+
- `okhstFunc` → `okhstFunction`
|
|
145
|
+
- `createColorFunc(name, channelLabel, convert)` → `createColorFunc(name, convert, label?)` — the label is now an optional trailing argument used only to format development warnings
|
|
146
|
+
|
|
147
|
+
**Parser** (`@tenphi/tasty/core`):
|
|
148
|
+
|
|
149
|
+
- `ParserOptions.funcs` → `ParserOptions.functions`
|
|
150
|
+
- `StyleParser#setFuncs()` → `StyleParser#setFunctions()`
|
|
151
|
+
|
|
152
|
+
**Debug types:** the debug-local `ChunkInfo` is now `DebugChunkInfo`, so it no longer collides with the parser's `ChunkInfo`.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 5. Removed exports
|
|
157
|
+
|
|
158
|
+
| Removed | Use instead |
|
|
159
|
+
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
160
|
+
| `getIsTestEnvironment()` | `isTestEnvironment()` |
|
|
161
|
+
| `hydrateTastyCache()` | `hydrateTastyClasses()` |
|
|
162
|
+
| `customFunc()` | `configure({ functions })` |
|
|
163
|
+
| `getGlobalFuncs()` | `getGlobalFunctions()` for `@function` definitions; the parse-function registry is internal |
|
|
164
|
+
| `resetGlobalFuncs()` | `resetConfig()` |
|
|
165
|
+
| `setGlobalPredefinedTokens()` | `configure({ replaceTokens })` |
|
|
166
|
+
| `resetGlobalPredefinedTokens()` | `resetConfig()` |
|
|
167
|
+
| `setMiddlewareTransferCache()` / `getMiddlewareTransferCache()` | internal; no replacement needed |
|
|
168
|
+
| `clearWriterCache()` | internal test utility |
|
|
169
|
+
| `DEFAULT_PLUGINS` | nothing — it was never consumed, and passing it to `configure({ plugins })` was a no-op. The default `okhsl`/`okhst` functions are registered automatically. |
|
|
170
|
+
| `registerDefaultFunctions()` | internal bootstrap helper |
|
|
171
|
+
| `warn()` / `deprecationWarning()` | internal helpers with no callers |
|
|
172
|
+
| `Bucket` enum | parser-internal |
|
|
173
|
+
| `Props` type | inline `Record<string, any>` |
|
|
174
|
+
| `UseStylesOptions` | `useStyles()` takes `Styles \| undefined` directly |
|
|
175
|
+
| `GlobalStyledProps` | its only member was the already-dead `breakpoints` prop |
|
|
176
|
+
| duplicate `PropertyOptions` | the single `PropertyOptions` from `injector/types` |
|
|
177
|
+
|
|
178
|
+
`getGlobalFuncs()` deserves a note: it returned the **live mutable internal registry**, and writing to it bypassed the parser's cache invalidation, so the write silently never took effect. If you were mutating it, move to `configure({ functions })`.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 6. Removed props
|
|
183
|
+
|
|
184
|
+
`css`, `block`, `inline`, and `breakpoints` are gone from `BaseProps` / `TastySpecificKeys`. All four were typed but never consumed — passing them did nothing in v2 either.
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 7. Moved subpath
|
|
189
|
+
|
|
190
|
+
```diff
|
|
191
|
+
- import { withTasty } from '@tenphi/tasty/next';
|
|
192
|
+
+ import { withTasty } from '@tenphi/tasty/zero/next';
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
The build-time extraction Next.js wrapper already lived under the `zero` namespace internally; the top-level `/next` path collided confusingly with `@tenphi/tasty/ssr/next`, which is a different integration.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## 8. Behavior changes that are not renames
|
|
200
|
+
|
|
201
|
+
**Repeated `configure()` calls now merge.** `recipes`, `keyframes`, `properties`, `fontFaces`, `counterStyles`, and CSS `@function` definitions used to replace wholesale, so a design-system `configure()` followed by an application `configure()` silently dropped the design system's values. All of them now merge, with the later call winning on a key conflict — matching `tokens` and `globalStyles`, which already merged. If you were relying on a second call to _clear_ a collection, use `resetConfig()`.
|
|
202
|
+
|
|
203
|
+
`configure({ polyfills })` is now correctly rejected after the first render, like every sibling option, and shallow-merges so an unrelated later call cannot switch a polyfill off.
|
|
204
|
+
|
|
205
|
+
**The `theme` prop is now implemented.** It maps to a `data-theme` attribute on the rendered element; previously it fell through and was spread onto the DOM raw. Augment `TastyThemeNames` for autocomplete.
|
|
206
|
+
|
|
207
|
+
**`tasty(Component, options)` no longer leaks factory-only options.** `variants`, `elements`, `styleProps`, `modProps`, and `tokenProps` are stripped instead of being passed to the wrapped component as runtime props, matching the element factory.
|
|
208
|
+
|
|
209
|
+
**Replacing a built-in style handler now warns.** Built-in handlers are shared across style names, so `configure({ handlers: { fill } })` also takes over `image` and the whole `background-*` family, and `configure({ handlers: { display } })` takes down `flow`, `gap`, `hide`, `overflow`, `whiteSpace`, and `textOverflow`. This was always true; what's new is that a development-mode warning now names exactly what was displaced. If you see it, either declare the whole group and delegate the rest to `styleHandlers.*`, or pick a narrower name. See [Plugins](plugins.md#custom-style-handlers).
|
|
210
|
+
|
|
211
|
+
**Multi-dependency custom handlers are fixed.** A handler whose dependencies mixed known and unknown style names was invoked once per chunk with only _part_ of its dependencies, and could emit stale CSS. Unknown names now join their handler's chunk, so it is invoked once with all of them. No built-in style moved, so no existing class name changes.
|
|
212
|
+
|
|
213
|
+
**`isChecked` added to the root prop types.** It already worked at runtime; it was just missing from `BaseProps` / `AllBaseProps`.
|
|
214
|
+
|
|
215
|
+
**The `okhsl`/`okhst` "expected 3 values" warning is now development-only** and follows the `[Tasty]` prefix convention: `[Tasty] okhsl(): expected 3 values (H S L), got: …`. It previously fired in production.
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## 9. New in v3
|
|
220
|
+
|
|
221
|
+
Nothing here is required to upgrade.
|
|
222
|
+
|
|
223
|
+
- **CSS `@function` support** — reusable, parameterized functions via the `'@function'` styles key, the `useFunction` style function, or `configure({ functions })`. Works across client rendering, SSR/RSC, and build-time extraction. `configure({ polyfills: { functions: true } })` inlines every call into plain CSS for browsers that don't ship the at-rule yet. See [Style DSL](dsl.md#functions-function).
|
|
224
|
+
- **Custom color plugins with no core special-casing** — `okhsl`/`okhst` are now ordinary one-line plugins, and a third-party color space can achieve identical integration. New `createColorFunc` and `resolveFunctionColor` helpers.
|
|
225
|
+
- **`configure({ propHandlers })`** — props middleware for every component: props in, props out. The extension point for props that aren't style values.
|
|
226
|
+
- **`configure({ baseStyleProps })`** — expose style properties as props on every component without listing them in each `styleProps`.
|
|
227
|
+
- **`defineHandler(deps, fn)`** — infers a multi-dependency handler's parameter types from its dependency list.
|
|
228
|
+
- **Plugins can supply `properties`, `keyframes`, `fontFaces`, and `counterStyles`** in addition to what they already could.
|
|
229
|
+
- See [Plugins & Extension Points](plugins.md) for all of the above.
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Search-and-replace cheat sheet
|
|
234
|
+
|
|
235
|
+
Run these in order — the `Css` → `CSS` renames must happen before any broader pattern, and the quoted at-rule keys must stay quote-anchored so they can't hit `configure({ properties })`.
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# 1. Raw-CSS family (before anything that touches "Css")
|
|
239
|
+
rg -l 'getCssTextForClasses' | xargs sed -i '' 's/getCssTextForClasses/getCSSTextForClasses/g'
|
|
240
|
+
rg -l 'getCssTextForNode' | xargs sed -i '' 's/getCssTextForNode/getCSSTextForNode/g'
|
|
241
|
+
rg -l 'getCssText' | xargs sed -i '' 's/getCssText/getCSSText/g'
|
|
242
|
+
rg -l 'CssOptions' | xargs sed -i '' 's/CssOptions/CSSOptions/g'
|
|
243
|
+
|
|
244
|
+
# 2. Styles-object at-rule keys (quote-anchored)
|
|
245
|
+
rg -l "'@properties'" | xargs sed -i '' "s/'@properties'/'@property'/g"
|
|
246
|
+
rg -l "'@fontFace'" | xargs sed -i '' "s/'@fontFace'/'@font-face'/g"
|
|
247
|
+
rg -l "'@counterStyle'" | xargs sed -i '' "s/'@counterStyle'/'@counter-style'/g"
|
|
248
|
+
|
|
249
|
+
# 3. Config getters (word-anchored so the plural forms are not double-pluralized)
|
|
250
|
+
rg -l 'getGlobalFontFace\b' | xargs sed -i '' 's/getGlobalFontFace\b/getGlobalFontFaces/g'
|
|
251
|
+
rg -l 'getGlobalCounterStyle\b' | xargs sed -i '' 's/getGlobalCounterStyle\b/getGlobalCounterStyles/g'
|
|
252
|
+
rg -l 'getGlobalFunction\b' | xargs sed -i '' 's/getGlobalFunction\b/getGlobalFunctions/g'
|
|
253
|
+
|
|
254
|
+
# 4. Color functions and parser methods
|
|
255
|
+
rg -l 'okhslFunc\b' | xargs sed -i '' 's/okhslFunc\b/okhslFunction/g'
|
|
256
|
+
rg -l 'okhstFunc\b' | xargs sed -i '' 's/okhstFunc\b/okhstFunction/g'
|
|
257
|
+
rg -l 'setFuncs' | xargs sed -i '' 's/setFuncs/setFunctions/g'
|
|
258
|
+
|
|
259
|
+
# 5. Removed exports with direct replacements
|
|
260
|
+
rg -l 'getIsTestEnvironment' | xargs sed -i '' 's/getIsTestEnvironment/isTestEnvironment/g'
|
|
261
|
+
rg -l 'hydrateTastyCache' | xargs sed -i '' 's/hydrateTastyCache/hydrateTastyClasses/g'
|
|
262
|
+
|
|
263
|
+
# 6. Moved subpath
|
|
264
|
+
rg -l "@tenphi/tasty/next" | xargs sed -i '' "s|@tenphi/tasty/next|@tenphi/tasty/zero/next|g"
|
|
265
|
+
|
|
266
|
+
# 7. Verify nothing is left (should print nothing)
|
|
267
|
+
rg "getCssText|CssOptions|'@properties'|'@fontFace'|'@counterStyle'|okhs[lt]Func\b|setFuncs|getIsTestEnvironment|hydrateTastyCache|@tenphi/tasty/next|getGlobalFontFace\b|getGlobalCounterStyle\b|getGlobalFunction\b"
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
`configure({ funcs })` → `functions`, `fontFace` → `fontFaces`, and `counterStyle` → `counterStyles` are deliberately **not** scripted: those words appear in many other contexts, so change them by hand and let TypeScript find the call sites.
|
|
271
|
+
|
|
272
|
+
The directional shorthand cannot be scripted at all — the whole point is that the old form's meaning was not recoverable from its text. Run your app in development and follow the console warnings.
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Not changed
|
|
277
|
+
|
|
278
|
+
Worth stating explicitly, because it's easy to assume otherwise:
|
|
279
|
+
|
|
280
|
+
- **At-rule styles-object keys are CSS-spec-faithful, not JS-conventional.** `@keyframes`, `@property`, `@font-face`, `@counter-style`, `@function`, `@starting` — kebab-case, matching what Tasty emits.
|
|
281
|
+
- **The `func()` injector method stays abbreviated.** `function` is a reserved word.
|
|
282
|
+
- `injector.fontFace()` and `injector.counterStyle()` keep their singular names — only the _config keys_ and _getters_ were pluralized.
|
|
283
|
+
- `useFontFace` and `useCounterStyle` are unchanged.
|
|
284
|
+
- `configure({ properties })` and `autoPropertyTypes` are unchanged; only the styles-object `@property` key was renamed.
|
|
285
|
+
- **The deprecated style aliases are retained deliberately.** `backgroundColor`, `background`, `backgroundImage`, `flex`, `grid`, and `flexDirection` still carry `@deprecated` tags and still work. They are the guardrail that discourages their use in projects that have not enabled `@tenphi/eslint-plugin-tasty` yet — read the tags as guidance, not as a removal notice.
|