You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/contract/composite-types.md
+41-17Lines changed: 41 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,12 @@ title: Composite Types
6
6
7
7
Composite types combine multiple primitive types into structured values. They represent complex design decisions like borders, shadows, and typography styles.
8
8
9
+
## Requirements
10
+
11
+
- Composite variables MUST use an object in `$value`.
12
+
- The `$value` object MUST match the property list for that composite type.
13
+
- Each property value MUST be a literal of the expected type or a reference to one.
14
+
9
15
## Border
10
16
11
17
`$type: "border"`
@@ -50,9 +56,9 @@ Stroke style values:
50
56
51
57
Property-level references:
52
58
53
-
-`{variable.width}` - border width
54
-
-`{variable.color}` - border color
55
-
-`{variable.style}` - border style
59
+
-`{variable.width}`: border width
60
+
-`{variable.color}`: border color
61
+
-`{variable.style}`: border style
56
62
57
63
## Transition
58
64
@@ -92,9 +98,9 @@ Example:
92
98
93
99
Property-level references:
94
100
95
-
-`{variable.duration}` - transition duration
96
-
-`{variable.delay}` - transition delay
97
-
-`{variable.timingFunction}` - timing function
101
+
-`{variable.duration}`: transition duration
102
+
-`{variable.delay}`: transition delay
103
+
-`{variable.timingFunction}`: timing function
98
104
99
105
## Shadow
100
106
@@ -141,11 +147,11 @@ Example:
141
147
142
148
Property-level references:
143
149
144
-
-`{variable.color}` - shadow color
145
-
-`{variable.offsetX}` - horizontal offset
146
-
-`{variable.offsetY}` - vertical offset
147
-
-`{variable.blur}` - blur radius
148
-
-`{variable.spread}` - spread radius
150
+
-`{variable.color}`: shadow color
151
+
-`{variable.offsetX}`: horizontal offset
152
+
-`{variable.offsetY}`: vertical offset
153
+
-`{variable.blur}`: blur radius
154
+
-`{variable.spread}`: spread radius
149
155
150
156
## Gradient
151
157
@@ -244,13 +250,32 @@ Example:
244
250
}
245
251
```
246
252
253
+
## Failure modes
254
+
255
+
If composite rules are ignored:
256
+
257
+
- Missing required fields for a composite type
258
+
- Property-level references point to incompatible types
259
+
- Consumers cannot render the composite correctly
260
+
261
+
## Validation checklist
262
+
263
+
-[ ] Each composite includes all required fields for its type
264
+
-[ ] Each field value matches the expected primitive type
265
+
-[ ] Property-level references resolve to matching fields
266
+
267
+
## Out of scope
268
+
269
+
- Runtime rendering rules for composites
270
+
- Tool-specific composite extensions
271
+
247
272
Property-level references:
248
273
249
-
-`{variable.fontFamily}` - font family
250
-
-`{variable.fontSize}` - font size
251
-
-`{variable.fontWeight}` - font weight
252
-
-`{variable.letterSpacing}` - letter spacing
253
-
-`{variable.lineHeight}` - line height
274
+
-`{variable.fontFamily}`: font family
275
+
-`{variable.fontSize}`: font size
276
+
-`{variable.fontWeight}`: font weight
277
+
-`{variable.letterSpacing}`: letter spacing
278
+
-`{variable.lineHeight}`: line height
254
279
255
280
## Composite type validation
256
281
@@ -421,4 +446,3 @@ A composite type is valid if:
421
446
- Custom composite types (use `$extensions` for metadata)
422
447
- Composite type coercion
423
448
- Runtime composite type validation libraries (use DTCG-compliant validators)
Copy file name to clipboardExpand all lines: docs/contract/dtcg-alignment.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,14 @@ Variable Design Standard (VDS) is DTCG 2025.10 compliant. What that means and wh
10
10
11
11
Variable Design Standard (VDS) uses the Design Tokens Community Group (DTCG) format 2025.10 as its base format. Variable Design Standard (VDS) extends DTCG with modes and convenience formats. Files using only DTCG features are strictly compliant. Files using modes or string shortcuts for dimension/duration are Variable Design Standard (VDS) format.
12
12
13
+
## Requirements
14
+
15
+
- Variable JSON MUST follow DTCG 2025.10 structure.
16
+
-`$type` and `$value` MUST exist on every variable.
17
+
- References MUST use curly brace syntax in Variable Design Standard (VDS) files.
18
+
- JSON Pointer references MAY be supported for DTCG compliance.
19
+
- Modes in `$value` are a Variable Design Standard (VDS) extension.
20
+
13
21
## What DTCG provides
14
22
15
23
DTCG 2025.10 defines:
@@ -61,6 +69,30 @@ Variable Design Standard (VDS) extends DTCG format with:
61
69
4. Validation that checks references resolve
62
70
5. Governance that treats renames as breaking changes
63
71
72
+
## Examples
73
+
74
+
Strict DTCG:
75
+
76
+
```json
77
+
{
78
+
"$type": "color",
79
+
"$value": {
80
+
"colorSpace": "srgb",
81
+
"components": [0, 0.4, 0.8],
82
+
"hex": "#0066cc"
83
+
}
84
+
}
85
+
```
86
+
87
+
Variable Design Standard (VDS) extension:
88
+
89
+
```json
90
+
{
91
+
"$type": "color",
92
+
"$value": "#0066cc"
93
+
}
94
+
```
95
+
64
96
## Strict DTCG compliance
65
97
66
98
For strict DTCG 2025.10 compliance, use:
@@ -93,3 +125,10 @@ If you ignore DTCG compliance:
0 commit comments