@bamboocss/types 1.16.1 → 1.17.1
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/dist/utility.d.ts +35 -0
- package/package.json +2 -2
package/dist/utility.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CssPropertyDefinition } from './config'
|
|
1
2
|
import type { LiteralUnion } from './shared'
|
|
2
3
|
import type { CssProperty, NestedCssProperties } from './system-types'
|
|
3
4
|
import type { Token, TokenCategory } from './tokens'
|
|
@@ -68,6 +69,40 @@ export interface PropertyConfig {
|
|
|
68
69
|
* Whether this utility is deprecated or not.
|
|
69
70
|
*/
|
|
70
71
|
deprecated?: boolean
|
|
72
|
+
/**
|
|
73
|
+
* Custom properties this utility composes its value from, registered with `@property`.
|
|
74
|
+
*
|
|
75
|
+
* Several utilities build one declaration out of many variables — `filter` out of nine,
|
|
76
|
+
* `translate` out of its axes — while a sibling utility sets each variable on its own. The
|
|
77
|
+
* ones nobody set still have to resolve to something harmless, and they must not be
|
|
78
|
+
* inherited: a parent's `--blur` reaching its children is a leak, not a default.
|
|
79
|
+
*
|
|
80
|
+
* Declaring them here is what registers them, so the utility that reads a variable is the
|
|
81
|
+
* thing that guarantees it exists. Keeping the two together is deliberate — a default kept
|
|
82
|
+
* in a separate list drifts from the composition it serves, in both directions: it outlives
|
|
83
|
+
* the utility that needed it, and it is forgotten for the utility added later.
|
|
84
|
+
*
|
|
85
|
+
* Registration is merged across every configured utility, so more than one may name the
|
|
86
|
+
* same variable — the utility that writes it and the one that reads it will often both
|
|
87
|
+
* want to.
|
|
88
|
+
*
|
|
89
|
+
* ```ts
|
|
90
|
+
* filter: {
|
|
91
|
+
* className: 'filter',
|
|
92
|
+
* values: { auto: 'var(--blur, ) var(--brightness, )' },
|
|
93
|
+
* customProperties: {
|
|
94
|
+
* '--blur': { syntax: '*', inherits: false },
|
|
95
|
+
* '--brightness': { syntax: '*', inherits: false },
|
|
96
|
+
* },
|
|
97
|
+
* }
|
|
98
|
+
* ```
|
|
99
|
+
*
|
|
100
|
+
* Omitting `initialValue` gives the property the guaranteed-invalid value, which is what a
|
|
101
|
+
* `var(--x, )` reference expects — it falls back to its own empty value and composes to
|
|
102
|
+
* nothing. A variable read *without* a fallback needs one declared here instead, or the
|
|
103
|
+
* whole declaration is invalid at computed-value time.
|
|
104
|
+
*/
|
|
105
|
+
customProperties?: Record<string, CssPropertyDefinition>
|
|
71
106
|
}
|
|
72
107
|
|
|
73
108
|
export type CssSemanticGroup =
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bamboocss/types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.1",
|
|
4
4
|
"description": "The types for css bamboo",
|
|
5
5
|
"homepage": "https://bamboocss.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"ncp": "2.0.0",
|
|
33
33
|
"pkg-types": "2.3.0",
|
|
34
34
|
"ts-morph": "28.0.0",
|
|
35
|
-
"@bamboocss/extractor": "1.
|
|
35
|
+
"@bamboocss/extractor": "1.17.1"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"dev": "tsx scripts/watch.ts",
|