@tenphi/tasty 0.0.0-snapshot.27699f6 → 0.0.0-snapshot.27b6708
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 +171 -107
- package/dist/{async-storage-B7_o6FKt.js → async-storage-DKK-wTD4.js} +1 -1
- package/dist/{async-storage-B7_o6FKt.js.map → async-storage-DKK-wTD4.js.map} +1 -1
- package/dist/babel-BUQGeOXA.d.ts +83 -0
- package/dist/{collector-QwpPODsy.js → collector-DTahQUiV.js} +97 -23
- package/dist/collector-DTahQUiV.js.map +1 -0
- package/dist/{collector-LuU1vZ68.d.ts → collector-DUaHCcTS.d.ts} +54 -7
- package/dist/{config-rrijM-U2.js → config-B5kHzuNz.js} +5144 -3012
- package/dist/config-B5kHzuNz.js.map +1 -0
- package/dist/{config-vuCRkBWX.d.ts → config-YsxGv4tq.d.ts} +412 -33
- package/dist/{context-CkSg-kDT.js → context-CA8YKeMn.js} +1 -1
- package/dist/{context-CkSg-kDT.js.map → context-CA8YKeMn.js.map} +1 -1
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +6 -6
- package/dist/{core-BvTG0J_M.js → core-Dr4u1NVD.js} +162 -188
- package/dist/core-Dr4u1NVD.js.map +1 -0
- package/dist/{css-writer-C7HJGEmN.js → css-writer-B-J87ncv.js} +78 -17
- package/dist/css-writer-B-J87ncv.js.map +1 -0
- package/dist/{format-global-rules-Dbc_1tc3.js → format-global-rules-DklyaXv-.js} +1 -1
- package/dist/{format-global-rules-Dbc_1tc3.js.map → format-global-rules-DklyaXv-.js.map} +1 -1
- package/dist/{format-rules-BvokPr1L.js → format-rules-DKOA-6qu.js} +4 -17
- package/dist/format-rules-DKOA-6qu.js.map +1 -0
- package/dist/{hydrate-Dsv7Pwon.js → hydrate-OeMX99We.js} +3 -11
- package/dist/{hydrate-Dsv7Pwon.js.map → hydrate-OeMX99We.js.map} +1 -1
- package/dist/{index-dUtwpOux.d.ts → index-Cd45t5NM.d.ts} +319 -64
- package/dist/{index-ZRxZWzlj.d.ts → index-PqN-DIpn.d.ts} +498 -189
- package/dist/index.d.ts +5 -5
- package/dist/index.js +253 -63
- package/dist/index.js.map +1 -1
- package/dist/{keyframes-DDqRjwa9.js → keyframes-CV8azJf3.js} +97 -191
- package/dist/keyframes-CV8azJf3.js.map +1 -0
- package/dist/{merge-styles-CtDJMhpJ.d.ts → merge-styles-CU7JbEwg.d.ts} +2 -2
- package/dist/{merge-styles-B8jV6zu3.js → merge-styles-oklji0KB.js} +2 -2
- package/dist/{merge-styles-B8jV6zu3.js.map → merge-styles-oklji0KB.js.map} +1 -1
- package/dist/{resolve-recipes-BnTZz2I_.js → resolve-recipes-DTG81rzl.js} +3 -3
- package/dist/{resolve-recipes-BnTZz2I_.js.map → resolve-recipes-DTG81rzl.js.map} +1 -1
- package/dist/ssr/astro-client.js +1 -1
- package/dist/ssr/astro-client.js.map +1 -1
- 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 +8 -6
- package/dist/ssr/astro-middleware.js +10 -10
- package/dist/ssr/astro-middleware.js.map +1 -1
- package/dist/ssr/astro.d.ts +2 -17
- package/dist/ssr/astro.js +29 -21
- package/dist/ssr/astro.js.map +1 -1
- package/dist/ssr/index.d.ts +2 -9
- package/dist/ssr/index.js +5 -5
- package/dist/ssr/index.js.map +1 -1
- package/dist/ssr/next.d.ts +2 -3
- package/dist/ssr/next.js +6 -7
- package/dist/ssr/next.js.map +1 -1
- package/dist/static/index.d.ts +2 -2
- package/dist/static/index.js +4 -4
- package/dist/static/index.js.map +1 -1
- package/dist/static/inject.js.map +1 -1
- package/dist/zero/babel.d.ts +2 -81
- package/dist/zero/babel.js +39 -27
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/index.d.ts +16 -2
- package/dist/zero/index.js +2 -2
- package/dist/zero/next.d.ts +1 -1
- package/dist/zero/next.js +1 -1
- package/dist/zero/next.js.map +1 -1
- package/docs/README.md +12 -6
- package/docs/adoption.md +53 -28
- package/docs/ai-agents.md +224 -0
- package/docs/comparison.md +59 -30
- package/docs/configuration.md +498 -69
- package/docs/debug.md +7 -7
- package/docs/design-system.md +43 -24
- package/docs/dsl.md +510 -178
- package/docs/getting-started.md +55 -34
- package/docs/injector.md +58 -5
- package/docs/methodology.md +68 -36
- package/docs/migration-v3.md +285 -0
- package/docs/pipeline.md +93 -25
- package/docs/plugins.md +349 -0
- package/docs/react-api.md +162 -38
- package/docs/ssr.md +45 -35
- package/docs/styles.md +65 -16
- package/docs/tasty-static.md +25 -8
- package/package.json +43 -21
- package/tasty.config.ts +6 -0
- package/dist/collector-QwpPODsy.js.map +0 -1
- package/dist/config-rrijM-U2.js.map +0 -1
- package/dist/core-BvTG0J_M.js.map +0 -1
- package/dist/css-writer-C7HJGEmN.js.map +0 -1
- package/dist/format-rules-BvokPr1L.js.map +0 -1
- package/dist/keyframes-DDqRjwa9.js.map +0 -1
|
@@ -22,6 +22,85 @@ declare class PropertyTypeResolver {
|
|
|
22
22
|
private isComplexValue;
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
|
+
//#region src/injector/batch.d.ts
|
|
26
|
+
/**
|
|
27
|
+
* Deferred CSSOM writes ("batched injection").
|
|
28
|
+
*
|
|
29
|
+
* Every `insertRule()` on a live stylesheet invalidates style for the sheet's
|
|
30
|
+
* scope, so Blink recalculates style the next time anything reads layout or
|
|
31
|
+
* computed style. When components inject during React's render phase and other
|
|
32
|
+
* components read layout in the same pass, the two interleave:
|
|
33
|
+
*
|
|
34
|
+
* inject -> read (forced recalc) -> inject -> read (forced recalc) -> ...
|
|
35
|
+
*
|
|
36
|
+
* Batching moves every sheet write out from between those reads. Writes are
|
|
37
|
+
* queued in FIFO order and drained in one go, so the tree is invalidated once
|
|
38
|
+
* per flush instead of once per component.
|
|
39
|
+
*
|
|
40
|
+
* ## Ordering
|
|
41
|
+
*
|
|
42
|
+
* A single queue holds *all* writes — component rules, global rules, keyframes,
|
|
43
|
+
* `@property`, `@font-face`, `@counter-style`, `@function` and raw CSS. Draining
|
|
44
|
+
* it in insertion order keeps the sheet byte-identical to unbatched output,
|
|
45
|
+
* which matters because equal-specificity rules resolve by document order.
|
|
46
|
+
*
|
|
47
|
+
* ## Batch windows — why queuing is safe
|
|
48
|
+
*
|
|
49
|
+
* Deferring a write past React's layout phase would let a `useLayoutEffect`
|
|
50
|
+
* measure an element whose rules are not in the sheet yet, reading the unstyled
|
|
51
|
+
* box. `<TastyBatchProvider>` closes that hole by opening a *window* during its
|
|
52
|
+
* render and closing it — flushing — in its `useInsertionEffect`, which React
|
|
53
|
+
* runs in the mutation phase, before any layout effect:
|
|
54
|
+
*
|
|
55
|
+
* provider renders -> window OPEN
|
|
56
|
+
* children render -> injections queued
|
|
57
|
+
* provider insertionEffect -> FLUSH, window CLOSED
|
|
58
|
+
* layout effects run -> rules are in the sheet
|
|
59
|
+
*
|
|
60
|
+
* So in the default (`batchInjection: true`) mode a write is only ever queued
|
|
61
|
+
* inside a commit whose flush is already guaranteed by that same commit. Every
|
|
62
|
+
* injection outside a window — a deep update the provider did not re-render
|
|
63
|
+
* for, a `useLayoutEffect` that injects, an event handler, an async callback —
|
|
64
|
+
* is written straight through, exactly as with batching off.
|
|
65
|
+
*
|
|
66
|
+
* `batchInjection: 'always'` opts out of the gate and queues unconditionally.
|
|
67
|
+
* That wins on more commits, at the cost of the measurement hazard above.
|
|
68
|
+
*
|
|
69
|
+
* ## Flush points (earliest wins)
|
|
70
|
+
*
|
|
71
|
+
* 1. `<TastyBatchProvider>`'s `useInsertionEffect` — closes the window.
|
|
72
|
+
* 2. A microtask — a backstop for a render that was aborted or suspended and
|
|
73
|
+
* therefore never reached its insertion effect. An aborted render mounts
|
|
74
|
+
* nothing, so nothing can measure what it queued. Microtasks also always
|
|
75
|
+
* drain before paint, so styles are never visually missing.
|
|
76
|
+
* 3. `flushStyles()` — explicit, and called internally by every injector read
|
|
77
|
+
* API (`getCSSText`, `cleanup`, `gc`, `destroy`, ...).
|
|
78
|
+
*/
|
|
79
|
+
interface QueuedWrite {
|
|
80
|
+
/** Perform the deferred sheet write. */
|
|
81
|
+
run: () => void;
|
|
82
|
+
/** Set when the owner disposed before the write happened. */
|
|
83
|
+
cancelled: boolean;
|
|
84
|
+
/** Set once the write has been applied (or skipped as cancelled). */
|
|
85
|
+
done: boolean;
|
|
86
|
+
}
|
|
87
|
+
/** Whether any write is still waiting to hit a stylesheet. */
|
|
88
|
+
declare function hasPendingStyleWrites(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Drain every pending sheet write, in insertion order.
|
|
91
|
+
*
|
|
92
|
+
* Safe to call when the queue is empty (the common case, so the guard comes
|
|
93
|
+
* first) and safe to call re-entrantly: a nested `flushStyles()` is a no-op,
|
|
94
|
+
* and work a draining write triggers is written in place by
|
|
95
|
+
* `enqueueStyleWrite` rather than queued behind the rest of the batch.
|
|
96
|
+
*/
|
|
97
|
+
declare function flushStyles(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Drop every pending write without applying it. Test helper — production code
|
|
100
|
+
* should call `flushStyles()` instead.
|
|
101
|
+
*/
|
|
102
|
+
declare function resetStyleBatch(): void;
|
|
103
|
+
//#endregion
|
|
25
104
|
//#region src/injector/types.d.ts
|
|
26
105
|
declare global {
|
|
27
106
|
interface Window {
|
|
@@ -50,12 +129,26 @@ interface StyleInjectorConfig {
|
|
|
50
129
|
states?: Record<string, string>;
|
|
51
130
|
/**
|
|
52
131
|
* Automatically infer and register CSS @property declarations
|
|
53
|
-
* from custom property values. When false, only explicit @
|
|
132
|
+
* from custom property values. When false, only explicit @property are used.
|
|
54
133
|
* @default true
|
|
55
134
|
*/
|
|
56
135
|
autoPropertyTypes?: boolean;
|
|
57
136
|
/** Garbage collection configuration for unused styles */
|
|
58
137
|
gc?: GCConfig;
|
|
138
|
+
/**
|
|
139
|
+
* Prefix prepended to every generated identifier.
|
|
140
|
+
* Mirrors the `namePrefix` field on the public `TastyConfig` so that
|
|
141
|
+
* standalone injector consumers can configure it directly.
|
|
142
|
+
* @default 't'
|
|
143
|
+
*/
|
|
144
|
+
namePrefix?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Defer stylesheet writes and apply them in one batch instead of one
|
|
147
|
+
* `insertRule()` per component. Mirrors `batchInjection` on the public
|
|
148
|
+
* `TastyConfig`.
|
|
149
|
+
* @default false
|
|
150
|
+
*/
|
|
151
|
+
batchInjection?: boolean | 'always';
|
|
59
152
|
}
|
|
60
153
|
/**
|
|
61
154
|
* Per-className usage tracking for GC.
|
|
@@ -112,6 +205,17 @@ interface SheetInfo {
|
|
|
112
205
|
constructableSheet?: CSSStyleSheet;
|
|
113
206
|
ruleCount: number;
|
|
114
207
|
holes: number[];
|
|
208
|
+
/**
|
|
209
|
+
* True when this sheet is written through `textContent` instead of CSSOM.
|
|
210
|
+
* Decided once at sheet creation so a sheet is never half CSSOM / half text.
|
|
211
|
+
*/
|
|
212
|
+
textMode?: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Inserted rule texts in rule-index order. Maintained only in text mode —
|
|
215
|
+
* it is what makes deletion possible there, since `textContent` cannot be
|
|
216
|
+
* edited rule-by-rule and has to be rebuilt.
|
|
217
|
+
*/
|
|
218
|
+
textRules?: string[];
|
|
115
219
|
}
|
|
116
220
|
interface CleanupStats {
|
|
117
221
|
timestamp: number;
|
|
@@ -150,8 +254,18 @@ interface RootRegistry {
|
|
|
150
254
|
injectedProperties: Map<string, string>;
|
|
151
255
|
/** Content hashes of injected @font-face rules for deduplication */
|
|
152
256
|
injectedFontFaces: Set<string>;
|
|
153
|
-
/**
|
|
154
|
-
|
|
257
|
+
/**
|
|
258
|
+
* Injected @counter-style rules. Maps the name to whether it was injected
|
|
259
|
+
* "strong" (`true`, the default — overrides) or "weak" (`false`, global
|
|
260
|
+
* `configure()` definitions that never clobber an existing rule).
|
|
261
|
+
*/
|
|
262
|
+
injectedCounterStyles: Map<string, boolean>;
|
|
263
|
+
/**
|
|
264
|
+
* Injected @function rules. Maps the CSS function name to whether it was
|
|
265
|
+
* injected "strong" (`true`, the default — overrides) or "weak" (`false`,
|
|
266
|
+
* global `configure()` definitions that never clobber an existing rule).
|
|
267
|
+
*/
|
|
268
|
+
injectedFunctions: Map<string, boolean>;
|
|
155
269
|
/** Global rules tracking for index adjustment */
|
|
156
270
|
globalRules: Map<string, RuleInfo>;
|
|
157
271
|
/** Resolver for auto-inferring @property types from declaration values */
|
|
@@ -160,12 +274,29 @@ interface RootRegistry {
|
|
|
160
274
|
usageMap: Map<string, StyleUsage>;
|
|
161
275
|
/** Touch counter for scheduling GC (per-root) */
|
|
162
276
|
touchCount: number;
|
|
277
|
+
/**
|
|
278
|
+
* Millisecond that `touchedTick` refers to. `touch()` only ever stamps
|
|
279
|
+
* `lastTouchedAt` with the current millisecond, so a repeat touch of the same
|
|
280
|
+
* class name inside one millisecond is a no-op worth skipping.
|
|
281
|
+
*/
|
|
282
|
+
touchTick: number;
|
|
283
|
+
/** Class-name strings already touched during `touchTick`. */
|
|
284
|
+
touchedTick: Set<string>;
|
|
163
285
|
/** How many entries from `window.__TASTY__` have been synced into this registry */
|
|
164
286
|
serverClassSyncIndex: number;
|
|
165
287
|
/** Whether `<style data-tasty-rsc>` tags have been scanned for class names */
|
|
166
288
|
rscStylesScanned: boolean;
|
|
167
289
|
/** Whether this root uses adoptedStyleSheets or <style> elements */
|
|
168
290
|
injectionMode: InjectionMode;
|
|
291
|
+
/**
|
|
292
|
+
* Lazy feature-test for `@property` support, cached per registry.
|
|
293
|
+
* - `undefined`: not yet probed.
|
|
294
|
+
* - `true`: engine supports `@property`; rejections indicate user-authored
|
|
295
|
+
* invalid rules and should warn.
|
|
296
|
+
* - `false`: engine doesn't support `@property` (e.g., jsdom); rejections
|
|
297
|
+
* are expected and warnings are suppressed.
|
|
298
|
+
*/
|
|
299
|
+
atPropertySupported?: boolean;
|
|
169
300
|
}
|
|
170
301
|
type StyleRule = StyleResult;
|
|
171
302
|
interface KeyframesInfo {
|
|
@@ -185,6 +316,12 @@ interface KeyframesCacheEntry {
|
|
|
185
316
|
name: string;
|
|
186
317
|
refCount: number;
|
|
187
318
|
info: KeyframesInfo;
|
|
319
|
+
/**
|
|
320
|
+
* Queued sheet write, when `batchInjection` deferred the insertion. Present
|
|
321
|
+
* only between `keyframes()` and the flush; disposing in that window cancels
|
|
322
|
+
* the write instead of deleting a rule that was never inserted.
|
|
323
|
+
*/
|
|
324
|
+
pending?: QueuedWrite;
|
|
188
325
|
}
|
|
189
326
|
/**
|
|
190
327
|
* Definition for a CSS @property at-rule.
|
|
@@ -198,6 +335,51 @@ interface PropertyDefinition {
|
|
|
198
335
|
/** Initial value for the property */
|
|
199
336
|
initialValue?: string | number;
|
|
200
337
|
}
|
|
338
|
+
/**
|
|
339
|
+
* Options for registering a CSS `@property`.
|
|
340
|
+
* Extends {@link PropertyDefinition} with an optional injection root.
|
|
341
|
+
*/
|
|
342
|
+
interface PropertyOptions extends PropertyDefinition {
|
|
343
|
+
/** Shadow root or document to inject into */
|
|
344
|
+
root?: Document | ShadowRoot;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* A single parameter for a CSS @function at-rule.
|
|
348
|
+
*
|
|
349
|
+
* - `true` — a bare parameter with no type or default.
|
|
350
|
+
* - `string` — a CSS type shorthand (e.g. `'<length>'`, `'<color>'`).
|
|
351
|
+
* - object — full form with optional `syntax` (type) and `default` value.
|
|
352
|
+
*/
|
|
353
|
+
type FunctionParameter = true | string | {
|
|
354
|
+
syntax?: string;
|
|
355
|
+
default?: string | number;
|
|
356
|
+
};
|
|
357
|
+
/**
|
|
358
|
+
* Definition for a CSS @function at-rule (custom function).
|
|
359
|
+
*
|
|
360
|
+
* The descriptor body reads like a mini styles object: any `$name` key declares
|
|
361
|
+
* a local variable (`--name`) whose value is parsed through the Tasty DSL.
|
|
362
|
+
* `result` is the only required field.
|
|
363
|
+
*
|
|
364
|
+
* @example
|
|
365
|
+
* ```ts
|
|
366
|
+
* // @function --negative(--value) { result: calc(-1 * var(--value)); }
|
|
367
|
+
* { args: ['$value'], result: '(-1 * $value)' }
|
|
368
|
+
* ```
|
|
369
|
+
*/
|
|
370
|
+
interface FunctionDefinition {
|
|
371
|
+
/**
|
|
372
|
+
* Ordered parameters. Array form lists bare parameter names (`['$value']`);
|
|
373
|
+
* object form maps each parameter name to its type/default.
|
|
374
|
+
*/
|
|
375
|
+
args?: string[] | Record<string, FunctionParameter>;
|
|
376
|
+
/** Optional return type, e.g. `'<color>'`. */
|
|
377
|
+
returns?: string;
|
|
378
|
+
/** The `result:` descriptor value (parsed through the Tasty DSL). Required. */
|
|
379
|
+
result: string;
|
|
380
|
+
/** Local variables: any `$name` key declares `--name` in the body. */
|
|
381
|
+
[localVar: `$${string}`]: string | number | undefined;
|
|
382
|
+
}
|
|
201
383
|
/**
|
|
202
384
|
* Descriptors for a CSS @font-face at-rule.
|
|
203
385
|
*/
|
|
@@ -262,11 +444,6 @@ interface RawCSSResult {
|
|
|
262
444
|
interface CSSProperties extends Properties<string | number> {}
|
|
263
445
|
//#endregion
|
|
264
446
|
//#region src/parser/types.d.ts
|
|
265
|
-
declare enum Bucket {
|
|
266
|
-
Color = 0,
|
|
267
|
-
Value = 1,
|
|
268
|
-
Mod = 2
|
|
269
|
-
}
|
|
270
447
|
/**
|
|
271
448
|
* A part within a group, representing a slash-separated segment.
|
|
272
449
|
* For example, in `'2px solid #red / 4px'`, there are two parts:
|
|
@@ -305,7 +482,7 @@ interface ProcessedStyle {
|
|
|
305
482
|
}
|
|
306
483
|
type UnitHandler = (scalar: number) => string;
|
|
307
484
|
interface ParserOptions {
|
|
308
|
-
|
|
485
|
+
functions?: Record<string, (parsed: StyleDetails[]) => string>;
|
|
309
486
|
units?: Record<string, string | UnitHandler>;
|
|
310
487
|
cacheSize?: number;
|
|
311
488
|
}
|
|
@@ -316,7 +493,7 @@ declare class StyleParser {
|
|
|
316
493
|
private cache;
|
|
317
494
|
constructor(opts?: ParserOptions);
|
|
318
495
|
process(src: string): ProcessedStyle;
|
|
319
|
-
|
|
496
|
+
setFunctions(functions: Required<ParserOptions>['functions']): void;
|
|
320
497
|
setUnits(units: Required<ParserOptions>['units']): void;
|
|
321
498
|
updateOptions(patch: Partial<ParserOptions>): void;
|
|
322
499
|
/**
|
|
@@ -344,6 +521,11 @@ declare class StyleParser {
|
|
|
344
521
|
* Reference: https://bottosson.github.io/posts/oklab/
|
|
345
522
|
*/
|
|
346
523
|
type Vec3 = [number, number, number];
|
|
524
|
+
/**
|
|
525
|
+
* sRGB gamma to linear. Only the sRGB-to-OKLab direction needs it, so this is
|
|
526
|
+
* test-only for the same reason as {@link srgbToOkhsl} — the forward path goes
|
|
527
|
+
* through {@link srgbLinearToGamma} instead.
|
|
528
|
+
*/
|
|
347
529
|
/**
|
|
348
530
|
* HSL to RGB.
|
|
349
531
|
* Algorithm from CSS Color 4 spec.
|
|
@@ -370,7 +552,7 @@ declare function hexToRgb(hex: string): string | null;
|
|
|
370
552
|
declare function getRgbValuesFromRgbaString(str: string): number[];
|
|
371
553
|
/**
|
|
372
554
|
* Convert any recognized color string to an `rgb()` CSS string.
|
|
373
|
-
* Handles hex, `okhsl()`, `hsl()`/`hsla()`, named CSS colors,
|
|
555
|
+
* Handles hex, `okhsl()`, `okhst()`, `hsl()`/`hsla()`, named CSS colors,
|
|
374
556
|
* and `rgb()`/`rgba()` pass-through.
|
|
375
557
|
*/
|
|
376
558
|
declare function strToRgb(color: string, _ignoreAlpha?: boolean): string | null | undefined;
|
|
@@ -393,12 +575,44 @@ type StyleValueStateMap<T = string> = Record<string, StyleValue<T> | '@inherit'>
|
|
|
393
575
|
* Use this for component props that accept style values.
|
|
394
576
|
*/
|
|
395
577
|
type StylePropValue<T = string> = StyleValue<T> | StyleValueStateMap<T>;
|
|
578
|
+
/**
|
|
579
|
+
* One dependency value as a style handler receives it: already resolved for a
|
|
580
|
+
* single state, but still the **raw authored DSL string** (`'2x'`, `'#purple.5'`).
|
|
581
|
+
* Handlers parse it themselves via {@link parseStyle} / {@link parseColor}.
|
|
582
|
+
*/
|
|
583
|
+
type ResolvedStyleValue = StyleValue<string>;
|
|
584
|
+
/**
|
|
585
|
+
* The dependency map a handler receives — one resolved value per style name in
|
|
586
|
+
* its `__lookupStyles`.
|
|
587
|
+
*/
|
|
588
|
+
type StyleHandlerProps<TDeps extends string = string> = Partial<Record<TDeps, ResolvedStyleValue>>;
|
|
589
|
+
/**
|
|
590
|
+
* One set of CSS declarations returned by a style handler.
|
|
591
|
+
*
|
|
592
|
+
* Keys are **kebab-case** CSS property names (`'background-color'`, not
|
|
593
|
+
* `backgroundColor`) or `--custom-property` names. Values are stringified, so
|
|
594
|
+
* numbers are accepted. `$` is reserved as a selector suffix.
|
|
595
|
+
*/
|
|
396
596
|
type CSSMap = {
|
|
397
|
-
|
|
398
|
-
} & Record<string, string | string[]>;
|
|
597
|
+
/** Selector suffix (or suffixes) these declarations apply to, e.g. `'& > *'`. */$?: string | string[];
|
|
598
|
+
} & Record<string, string | number | (string | number)[] | undefined>;
|
|
399
599
|
type StyleHandlerResult = CSSMap | CSSMap[] | null | void;
|
|
400
|
-
type RawStyleHandler = (
|
|
401
|
-
type StyleHandler = RawStyleHandler & {
|
|
600
|
+
type RawStyleHandler<TProps extends object = StyleHandlerProps> = (props: TProps) => StyleHandlerResult;
|
|
601
|
+
type StyleHandler<TProps extends object = StyleHandlerProps> = RawStyleHandler<TProps> & {
|
|
602
|
+
__lookupStyles: string[];
|
|
603
|
+
};
|
|
604
|
+
/**
|
|
605
|
+
* The handler type used by the registry (`STYLE_HANDLER_MAP`), with parameter
|
|
606
|
+
* variance erased.
|
|
607
|
+
*
|
|
608
|
+
* Handlers declare narrow, hand-written dependency types — `({ fill }: { fill?:
|
|
609
|
+
* string }) => …` — which under `strictFunctionTypes` are not assignable to a
|
|
610
|
+
* wider parameter type. The registry stores handlers of many different dependency
|
|
611
|
+
* shapes together, so it needs the erased form. Prefer {@link StyleHandler} (or
|
|
612
|
+
* {@link defineHandler}) when writing a handler; this type is for code that
|
|
613
|
+
* inspects the registry.
|
|
614
|
+
*/
|
|
615
|
+
type AnyStyleHandler = ((props: any) => StyleHandlerResult) & {
|
|
402
616
|
__lookupStyles: string[];
|
|
403
617
|
};
|
|
404
618
|
/**
|
|
@@ -406,8 +620,11 @@ type StyleHandler = RawStyleHandler & {
|
|
|
406
620
|
* - Function only: lookup styles inferred from key name
|
|
407
621
|
* - Single property tuple: ['styleName', handler]
|
|
408
622
|
* - Multi-property tuple: [['style1', 'style2'], handler]
|
|
623
|
+
*
|
|
624
|
+
* Use {@link defineHandler} to have the dependency names inferred into the
|
|
625
|
+
* handler's parameter type instead of annotating it by hand.
|
|
409
626
|
*/
|
|
410
|
-
type StyleHandlerDefinition = RawStyleHandler | [
|
|
627
|
+
type StyleHandlerDefinition<TDeps extends string = string> = RawStyleHandler<StyleHandlerProps<TDeps>> | [TDeps, RawStyleHandler<StyleHandlerProps<TDeps>>] | [readonly TDeps[], RawStyleHandler<StyleHandlerProps<TDeps>>];
|
|
411
628
|
interface ParsedColor {
|
|
412
629
|
color?: string;
|
|
413
630
|
name?: string;
|
|
@@ -423,36 +640,16 @@ declare const CUSTOM_UNITS: {
|
|
|
423
640
|
sf: (num: number) => string;
|
|
424
641
|
};
|
|
425
642
|
declare const DIRECTIONS: string[];
|
|
426
|
-
declare function customFunc(name: string, fn: (groups: StyleDetails[]) => string): void;
|
|
427
643
|
/**
|
|
428
644
|
* Get the global StyleParser instance.
|
|
429
645
|
* Used by configure() to apply parser configuration.
|
|
430
646
|
*/
|
|
431
647
|
declare function getGlobalParser(): StyleParser;
|
|
432
|
-
/**
|
|
433
|
-
* Get the current custom functions registry.
|
|
434
|
-
* Used by configure() to merge with new functions.
|
|
435
|
-
*/
|
|
436
|
-
declare function getGlobalFuncs(): Record<string, (groups: StyleDetails[]) => string>;
|
|
437
|
-
/**
|
|
438
|
-
* Set global predefined tokens.
|
|
439
|
-
* Called from configure() after processing token values.
|
|
440
|
-
* Merges with existing tokens (new tokens override existing ones with same key).
|
|
441
|
-
* Keys are normalized to lowercase (parser lowercases input before classification).
|
|
442
|
-
* @internal
|
|
443
|
-
*/
|
|
444
|
-
declare function setGlobalPredefinedTokens(tokens: Record<string, string>): void;
|
|
445
648
|
/**
|
|
446
649
|
* Get the current global predefined tokens.
|
|
447
650
|
* Returns null if no tokens are configured.
|
|
448
651
|
*/
|
|
449
652
|
declare function getGlobalPredefinedTokens(): Record<string, string> | null;
|
|
450
|
-
/**
|
|
451
|
-
* Reset global predefined tokens.
|
|
452
|
-
* Used for testing.
|
|
453
|
-
* @internal
|
|
454
|
-
*/
|
|
455
|
-
declare function resetGlobalPredefinedTokens(): void;
|
|
456
653
|
/**
|
|
457
654
|
*
|
|
458
655
|
* @param {String} value
|
|
@@ -589,9 +786,12 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
589
786
|
/**
|
|
590
787
|
* The fade style applies gradient-based fading masks to the edges of an element. Replaces complex CSS mask gradients with a simple, declarative API.
|
|
591
788
|
*
|
|
592
|
-
* Syntax: `[width] [
|
|
789
|
+
* Syntax: `[width] [direction...] [#from-color] [#to-color]`
|
|
593
790
|
*
|
|
594
|
-
* Multiple groups can be separated by commas to specify different
|
|
791
|
+
* Multiple groups can be separated by commas to specify different widths and
|
|
792
|
+
* colors per direction. A group that names edges takes a single width, applied
|
|
793
|
+
* to every edge it names; a group that names none covers all four edges and
|
|
794
|
+
* keeps plain CSS shorthand order.
|
|
595
795
|
*
|
|
596
796
|
* Color tokens (optional):
|
|
597
797
|
* - First color: transparent start of gradient (default: `rgb(0 0 0 / 0)`)
|
|
@@ -600,14 +800,16 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
600
800
|
* Examples:
|
|
601
801
|
* - `fade="top"` // fade only top edge with default width
|
|
602
802
|
* - `fade="2x left right"` // fade left and right edges with 2x width
|
|
803
|
+
* - `fade={true}` // all edges at the design-system default width
|
|
603
804
|
* - `fade="1x top"` // fade only top edge with 1x width
|
|
604
|
-
* - `fade="3x 1x
|
|
805
|
+
* - `fade="3x 1x"` // all edges: top/bottom 3x, left/right 1x
|
|
806
|
+
* - `fade="3x top, 1x bottom"` // top: 3x width, bottom: 1x width
|
|
605
807
|
* - `fade="2x #transparent #dark"` // custom colors for gradient mask
|
|
606
808
|
* - `fade="1x top #clear #solid"` // top edge with custom mask colors
|
|
607
809
|
* - `fade="top #red #blue, bottom #green #yellow"` // different colors per direction
|
|
608
810
|
* - `fade="2x top #a #b, 1x bottom #c #d"` // different widths and colors per direction
|
|
609
811
|
*/
|
|
610
|
-
fade?: 'top' | 'right' | 'bottom' | 'left' | string;
|
|
812
|
+
fade?: 'top' | 'right' | 'bottom' | 'left' | string | boolean;
|
|
611
813
|
/**
|
|
612
814
|
* Scrollbar styling using standard CSS properties (`scrollbar-width`, `scrollbar-color`, `scrollbar-gutter`).
|
|
613
815
|
*
|
|
@@ -644,20 +846,28 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
644
846
|
/**
|
|
645
847
|
* Shorthand for element padding. Supports custom units, directional modifiers, and design-system-driven defaults.
|
|
646
848
|
*
|
|
849
|
+
* A group that names directions takes a single value, applied to every
|
|
850
|
+
* direction it names — use comma groups for per-side values.
|
|
851
|
+
*
|
|
647
852
|
* Examples:
|
|
648
853
|
* - `padding="2x 1x"` // top/bottom: 2x, left/right: 1x
|
|
649
854
|
* - `padding="2x top"` // only top padding: 2x
|
|
650
855
|
* - `padding="1x left right"` // left and right padding: 1x
|
|
856
|
+
* - `padding="2x top, 4x right"` // top: 2x, right: 4x, bottom/left: 0
|
|
651
857
|
* - `padding={true}` // default padding on all sides
|
|
652
858
|
*/
|
|
653
859
|
padding?: CSSProperties['padding'] | string | boolean;
|
|
654
860
|
/**
|
|
655
861
|
* Shorthand for element margin. Supports custom units, directional modifiers, and design-system-driven defaults.
|
|
656
862
|
*
|
|
863
|
+
* A group that names directions takes a single value, applied to every
|
|
864
|
+
* direction it names — use comma groups for per-side values.
|
|
865
|
+
*
|
|
657
866
|
* Examples:
|
|
658
867
|
* - `margin="2x 1x"` // top/bottom: 2x, left/right: 1x
|
|
659
868
|
* - `margin="2x top"` // only top margin: 2x
|
|
660
869
|
* - `margin="1x left right"` // left and right margin: 1x
|
|
870
|
+
* - `margin="2x top, 4x right"` // top: 2x, right: 4x, bottom/left: 0
|
|
661
871
|
* - `margin={true}` // default margin on all sides
|
|
662
872
|
*/
|
|
663
873
|
margin?: CSSProperties['margin'] | string | boolean;
|
|
@@ -706,6 +916,11 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
706
916
|
* - `border="dotted #danger left right"` // left/right: 1bw dotted danger
|
|
707
917
|
* - `border="1bw #red, 2bw #blue top"` // all sides red 1bw, top overridden to blue 2bw
|
|
708
918
|
* - `border="1bw, dashed top bottom, #purple left right"` // base 1bw, dashed on top/bottom, purple on left/right
|
|
919
|
+
* - `border="1bw $my-style"` // custom property in the style slot
|
|
920
|
+
*
|
|
921
|
+
* A `$name` reference fills the first free slot — width, then style, then
|
|
922
|
+
* color. Colors are authored as `#name`; to point the color slot at a raw
|
|
923
|
+
* custom property directly, name it `$name-color`.
|
|
709
924
|
*/
|
|
710
925
|
border?: CSSProperties['border'] | string | boolean;
|
|
711
926
|
/**
|
|
@@ -744,14 +959,17 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
744
959
|
* Syntax: `[value] [modifiers]` | `[shape]` | `true`
|
|
745
960
|
*
|
|
746
961
|
* Shapes: `round` (fully rounded), `ellipse` (50%), `leaf`, `backleaf` (asymmetric), `inherit` (inherit from parent)
|
|
747
|
-
*
|
|
962
|
+
* Edge modifiers: `top`, `right`, `bottom`, `left` — the corner pair along that edge
|
|
963
|
+
* Corner modifiers: `top-left`, `top-right`, `bottom-right`, `bottom-left` — a single corner
|
|
748
964
|
*
|
|
749
965
|
* Examples:
|
|
750
966
|
* - `radius="2r"` // border-radius: calc(var(--radius) * 2)
|
|
751
967
|
* - `radius={true}` // default radius (1r)
|
|
752
968
|
* - `radius="round"` // fully rounded (9999rem)
|
|
753
969
|
* - `radius="leaf"` // asymmetric leaf shape
|
|
754
|
-
* - `radius="1r top"` // round
|
|
970
|
+
* - `radius="1r top"` // round both top corners
|
|
971
|
+
* - `radius="top-right"` // round only the top-right corner (1r)
|
|
972
|
+
* - `radius="4px top-left"` // round only the top-left corner
|
|
755
973
|
* - `radius="inherit"` // inherit border-radius from parent
|
|
756
974
|
* - `radius="inherit right"` // inherit only right corners (uses longhand properties)
|
|
757
975
|
*/
|
|
@@ -821,6 +1039,11 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
821
1039
|
* - `outline="2ow dashed #purple"` // 2ow dashed purple outline
|
|
822
1040
|
* - `outline="2ow #danger / 1x"` // 2ow solid danger outline, 1x offset
|
|
823
1041
|
* - `outline={true}` // default outline (1ow solid)
|
|
1042
|
+
* - `outline="2ow $my-style"` // custom property in the style slot
|
|
1043
|
+
*
|
|
1044
|
+
* A `$name` reference fills the first free slot — width, then style, then
|
|
1045
|
+
* color. Colors are authored as `#name`; to point the color slot at a raw
|
|
1046
|
+
* custom property directly, name it `$name-color`.
|
|
824
1047
|
*/
|
|
825
1048
|
outline?: string | boolean;
|
|
826
1049
|
/**
|
|
@@ -834,13 +1057,17 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
834
1057
|
/**
|
|
835
1058
|
* The preset style sets base text settings according to named presets. Affects `font-size`, `line-height`, `letter-spacing`, `font-weight`, and `text-transform`.
|
|
836
1059
|
*
|
|
837
|
-
* Syntax: `name`, `name / modifier
|
|
1060
|
+
* Syntax: `name`, `name / modifier...`, or `modifier...` (shorthand, name defaults to `inherit`).
|
|
1061
|
+
* Multiple modifiers are space-separated and combine freely (e.g. `strong italic tight`).
|
|
838
1062
|
* Preset names are project-specific. Augment `TastyPresetNames` to register them for autocomplete.
|
|
839
1063
|
*
|
|
840
1064
|
* Examples:
|
|
841
1065
|
* - `preset="h1"` // heading 1 typography
|
|
842
1066
|
* - `preset="h2 / strong"` // bold heading 2
|
|
1067
|
+
* - `preset="h2 / strong italic"` // bold + italic heading 2
|
|
1068
|
+
* - `preset="t2 / strong tight"` // bold text 2 with tight line-height
|
|
843
1069
|
* - `preset="bold"` // inherit with bold (shorthand)
|
|
1070
|
+
* - `preset="bold italic"` // inherit with bold + italic (shorthand)
|
|
844
1071
|
* - `preset="t3"` // text size 3
|
|
845
1072
|
*/
|
|
846
1073
|
preset?: PresetName | (string & {});
|
|
@@ -893,6 +1120,7 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
893
1120
|
* Examples:
|
|
894
1121
|
* - `scrollMargin="2x"` // scroll-margin on all sides: 2x
|
|
895
1122
|
* - `scrollMargin="2x top"` // only top scroll-margin: 2x
|
|
1123
|
+
* - `scrollMargin="2x top, 4x bottom"` // top: 2x, bottom: 4x
|
|
896
1124
|
* - `scrollMargin={true}` // default scroll-margin on all sides
|
|
897
1125
|
*/
|
|
898
1126
|
scrollMargin?: CSSProperties['scrollMargin'] | string | boolean;
|
|
@@ -909,9 +1137,20 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
909
1137
|
* - `inset="0"` // all sides: 0
|
|
910
1138
|
* - `inset="2x top"` // only top offset: 2x
|
|
911
1139
|
* - `inset="1x left right"` // left and right offsets: 1x
|
|
1140
|
+
* - `inset="2x top, 4x right"` // top: 2x, right: 4x, bottom/left: auto
|
|
1141
|
+
* - `inset="bottom dock"` // bottom-anchored, full width: auto 0 0 0
|
|
912
1142
|
* - `inset={true}` // all sides: 0
|
|
1143
|
+
*
|
|
1144
|
+
* A group that names directions takes a single value, applied to every
|
|
1145
|
+
* direction it names — use comma groups for per-side values.
|
|
1146
|
+
*
|
|
1147
|
+
* The `dock` modifier pins the named edge and spans its full length, applying
|
|
1148
|
+
* the value to the two perpendicular sides as well. `dock` is the one case
|
|
1149
|
+
* where a directional group takes two values: the second applies to those
|
|
1150
|
+
* spanned sides, so `inset="2x 4x bottom dock"` pins the bottom at `2x` and
|
|
1151
|
+
* insets the sides by `4x`. Without `dock` a second value is ignored.
|
|
913
1152
|
*/
|
|
914
|
-
inset?: 'top' | 'right' | 'bottom' | 'left' | string | CSSProperties['inset'];
|
|
1153
|
+
inset?: 'top' | 'right' | 'bottom' | 'left' | 'dock' | string | CSSProperties['inset'];
|
|
915
1154
|
/**
|
|
916
1155
|
* Local keyframes definitions for this component.
|
|
917
1156
|
* Keys are animation names, values are keyframes step definitions.
|
|
@@ -931,28 +1170,42 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
931
1170
|
* - `#name` for color properties → `--name-color` (auto-sets syntax: '<color>', defaults initialValue: 'transparent')
|
|
932
1171
|
*
|
|
933
1172
|
* Examples:
|
|
934
|
-
* - `'@
|
|
935
|
-
* - `'@
|
|
1173
|
+
* - `'@property': { '$rotation': { syntax: '<angle>', inherits: false, initialValue: '45deg' } }`
|
|
1174
|
+
* - `'@property': { '#theme': { initialValue: 'purple' } }` // syntax: '<color>' is auto-set
|
|
936
1175
|
*/
|
|
937
|
-
'@
|
|
1176
|
+
'@property'?: Record<string, PropertyDefinition>;
|
|
938
1177
|
/**
|
|
939
1178
|
* Local @font-face definitions for this component.
|
|
940
1179
|
* Keys are font-family names, values are descriptors or arrays of descriptors
|
|
941
1180
|
* (for multiple weights/styles of the same family).
|
|
942
1181
|
*
|
|
943
1182
|
* Examples:
|
|
944
|
-
* - `'@
|
|
945
|
-
* - `'@
|
|
1183
|
+
* - `'@font-face': { Icons: { src: 'url("/fonts/icons.woff2") format("woff2")', fontDisplay: 'block' } }`
|
|
1184
|
+
* - `'@font-face': { 'Brand Sans': [{ src: '...', fontWeight: 400 }, { src: '...', fontWeight: 700 }] }`
|
|
946
1185
|
*/
|
|
947
|
-
'@
|
|
1186
|
+
'@font-face'?: Record<string, FontFaceInput>;
|
|
948
1187
|
/**
|
|
949
1188
|
* Local @counter-style definitions for this component.
|
|
950
1189
|
* Keys are counter-style names, values are descriptor objects.
|
|
951
1190
|
*
|
|
952
1191
|
* Examples:
|
|
953
|
-
* - `'@
|
|
1192
|
+
* - `'@counter-style': { thumbs: { system: 'cyclic', symbols: '"👍"', suffix: '" "' } }`
|
|
1193
|
+
*/
|
|
1194
|
+
'@counter-style'?: Record<string, CounterStyleDescriptors>;
|
|
1195
|
+
/**
|
|
1196
|
+
* Local @function definitions (CSS custom functions) for this component.
|
|
1197
|
+
* Keys are function names using `$$name` (the literal callable `--name`),
|
|
1198
|
+
* matching the call site `$$name(...)`. Values are function definitions.
|
|
1199
|
+
*
|
|
1200
|
+
* Local variables are declared directly as `$name` keys on the descriptor;
|
|
1201
|
+
* `result`, local-var values, and parameter defaults are parsed through the
|
|
1202
|
+
* Tasty DSL (units, color tokens, auto-calc, fallbacks).
|
|
1203
|
+
*
|
|
1204
|
+
* Examples:
|
|
1205
|
+
* - `'@function': { '$$negative': { args: ['$value'], result: '(-1 * $value)' } }`
|
|
1206
|
+
* - `'@function': { '$$shadow': { args: { '$color': { syntax: '<color>', default: 'inherit' } }, returns: '<color>', '$offset': '2px', result: '$offset $offset ($color, black)' } }`
|
|
954
1207
|
*/
|
|
955
|
-
'@
|
|
1208
|
+
'@function'?: Record<string, FunctionDefinition>;
|
|
956
1209
|
/**
|
|
957
1210
|
* Apply one or more predefined style recipes by name.
|
|
958
1211
|
* Recipes are defined globally via `configure({ recipes: { ... } })`.
|
|
@@ -973,7 +1226,7 @@ type SuffixForSelector = '&' | '.' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | '
|
|
|
973
1226
|
type Selector = `${SuffixForSelector}${string}`;
|
|
974
1227
|
type NotSelector = Exclude<string, Selector | keyof StylesInterface>;
|
|
975
1228
|
/** Special style keys that should not be wrapped in StyleValue/StyleValueStateMap */
|
|
976
|
-
type SpecialStyleKeys = '@keyframes' | '@
|
|
1229
|
+
type SpecialStyleKeys = '@keyframes' | '@property' | '@font-face' | '@counter-style' | '@function' | 'recipe';
|
|
977
1230
|
type StylesWithoutSelectors = { [key in keyof StylesInterface as key extends SpecialStyleKeys ? never : key]?: StyleValue<StylesInterface[key]> | StyleValueStateMap<StylesInterface[key]> };
|
|
978
1231
|
/**
|
|
979
1232
|
* Index signature for recipe-specific arbitrary keys.
|
|
@@ -984,27 +1237,29 @@ type StylesWithoutSelectors = { [key in keyof StylesInterface as key extends Spe
|
|
|
984
1237
|
type RecipeIndexSignature = Record<string, StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined>>;
|
|
985
1238
|
/**
|
|
986
1239
|
* Style type for recipe definitions.
|
|
987
|
-
* Like StylesWithoutSelectors but also allows `@keyframes`, `@
|
|
1240
|
+
* Like StylesWithoutSelectors but also allows `@keyframes`, `@property`,
|
|
988
1241
|
* local predefined states, and vendor-prefixed CSS properties.
|
|
989
1242
|
* Excludes `recipe` to prevent recursive references.
|
|
990
1243
|
*/
|
|
991
1244
|
type RecipeStyles = StylesWithoutSelectors & RecipeIndexSignature & {
|
|
992
1245
|
'@keyframes'?: StylesInterface['@keyframes'];
|
|
993
|
-
'@
|
|
994
|
-
'@
|
|
995
|
-
'@
|
|
1246
|
+
'@property'?: StylesInterface['@property'];
|
|
1247
|
+
'@font-face'?: StylesInterface['@font-face'];
|
|
1248
|
+
'@counter-style'?: StylesInterface['@counter-style'];
|
|
1249
|
+
'@function'?: StylesInterface['@function'];
|
|
996
1250
|
};
|
|
997
1251
|
/** Special properties that are not regular style values */
|
|
998
1252
|
interface SpecialStyleProperties {
|
|
999
1253
|
'@keyframes'?: StylesInterface['@keyframes'];
|
|
1000
|
-
'@
|
|
1001
|
-
'@
|
|
1002
|
-
'@
|
|
1254
|
+
'@property'?: StylesInterface['@property'];
|
|
1255
|
+
'@font-face'?: StylesInterface['@font-face'];
|
|
1256
|
+
'@counter-style'?: StylesInterface['@counter-style'];
|
|
1257
|
+
'@function'?: StylesInterface['@function'];
|
|
1003
1258
|
recipe?: StylesInterface['recipe'];
|
|
1004
1259
|
}
|
|
1005
1260
|
/** Index signature for arbitrary style keys (sub-elements, CSS variables, etc.) */
|
|
1006
1261
|
interface StylesIndexSignature {
|
|
1007
|
-
[key: string]: StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined> | Styles | false | StylesInterface['@keyframes'] | StylesInterface['@
|
|
1262
|
+
[key: string]: StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined> | Styles | false | StylesInterface['@keyframes'] | StylesInterface['@property'] | StylesInterface['@font-face'] | StylesInterface['@counter-style'] | StylesInterface['@function'];
|
|
1008
1263
|
/**
|
|
1009
1264
|
* Selector combinator: `undefined` (descendant, default), `'>'` (child), `'+'` (adjacent), `'~'` (sibling).
|
|
1010
1265
|
* Can chain with capitalized names: `'> Body > Row >'`. Spaces required around combinators.
|
|
@@ -1022,7 +1277,7 @@ type ConfigTokenValue = string | number | boolean | Record<string, string | numb
|
|
|
1022
1277
|
* Keys must start with `$` (value tokens) or `#` (color tokens).
|
|
1023
1278
|
*
|
|
1024
1279
|
* - `$name` keys become `--name` CSS custom properties
|
|
1025
|
-
* - `#name` keys become `--name-color`
|
|
1280
|
+
* - `#name` keys become `--name-color` properties
|
|
1026
1281
|
*/
|
|
1027
1282
|
type ConfigTokens = Record<`$${string}` | `#${string}`, ConfigTokenValue>;
|
|
1028
1283
|
//#endregion
|
|
@@ -1262,5 +1517,5 @@ interface RenderStylesOptions {
|
|
|
1262
1517
|
declare function renderStyles(styles?: Styles, classNameOrSelector?: undefined, options?: undefined, pipelineCacheKey?: string): RenderResult;
|
|
1263
1518
|
declare function renderStyles(styles: Styles | undefined, classNameOrSelector: string, options?: RenderStylesOptions): StyleResult[];
|
|
1264
1519
|
//#endregion
|
|
1265
|
-
export {
|
|
1266
|
-
//# sourceMappingURL=index-
|
|
1520
|
+
export { StyleParser as $, ParsedColor as A, StyleUsage as At, StyleValueStateMap as B, SuffixForSelector as C, PropertyOptions as Ct, CSSMap as D, SheetInfo as Dt, AnyStyleHandler as E, RuleInfo as Et, StyleHandlerProps as F, parseColor as G, getGlobalParser as H, StyleHandlerResult as I, getNamedColorHex as J, parseStyle as K, StyleMap as L, ResolvedStyleValue as M, flushStyles as Mt, StyleHandler as N, hasPendingStyleWrites as Nt, CUSTOM_UNITS as O, StyleInjectorConfig as Ot, StyleHandlerDefinition as P, resetStyleBatch as Pt, strToRgb as Q, StylePropValue as R, StylesWithoutSelectors as S, PropertyDefinition as St, TastyPresetNames as T, RootRegistry as Tt, getGlobalPredefinedTokens as U, filterMods as V, normalizeColorTokenValue as W, hexToRgb as X, getRgbValuesFromRgbaString as Y, hslToRgbValues as Z, NotSelector as _, InjectionMode as _t, ParseStateKeyOptions as a, CSSProperties as at, Styles as b, KeyframesResult as bt, ParsedAdvancedState as c, DisposeFunction as ct, getGlobalPredefinedStates as d, FunctionDefinition as dt, ParserOptions as et, setGlobalPredefinedStates as f, FunctionParameter as ft, NoType as g, InjectResult as gt, ConfigTokens as h, GlobalInjectResult as ht, renderStyles as i, UnitHandler as it, RawStyleHandler as j, QueuedWrite as jt, DIRECTIONS as k, StyleRule as kt, StateParserContext as l, FontFaceDescriptors as lt, ConfigTokenValue as m, GCOptions as mt, StyleResult as n, StyleDetails as nt, parseStateKey as o, CacheMetrics as ot, ConditionNode as p, GCConfig as pt, stringifyStyles as q, isSelector as r, StyleDetailsPart as rt, AtRuleContext as s, CounterStyleDescriptors as st, RenderResult as t, ProcessedStyle as tt, createStateParserContext as u, FontFaceInput as ut, RecipeStyles as v, KeyframesCacheEntry as vt, TastyNamedColors as w, RawCSSResult as wt, StylesInterface as x, KeyframesSteps as xt, Selector as y, KeyframesInfo as yt, StyleValue as z };
|
|
1521
|
+
//# sourceMappingURL=index-Cd45t5NM.d.ts.map
|