-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoken.json
More file actions
256 lines (256 loc) · 8.22 KB
/
token.json
File metadata and controls
256 lines (256 loc) · 8.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
{
"token": {
"kind": "token",
"identifier": "color-text-primary",
"metadata": [
{
"kind": "description",
"value": "The default color for body text, headings, and labels. Provides the highest-contrast text color for standard reading content on default background surfaces."
},
{
"kind": "status",
"status": "stable",
"platformStatus": {
"css": {
"status": "stable",
"since": "2.0.0"
},
"ios": {
"status": "stable",
"since": "2.1.0"
},
"android": {
"status": "stable",
"since": "2.2.0"
},
"figma": {
"status": "stable",
"since": "2.0.0"
}
}
},
{
"kind": "since",
"value": "2.0.0"
},
{
"kind": "tags",
"items": [
"color",
"text",
"body"
]
},
{
"kind": "category",
"value": "semantic"
},
{
"kind": "aliases",
"items": [
"color.text.default",
"color.text.body"
]
},
{
"kind": "summary",
"value": "Default body text color for light and dark surfaces."
},
{
"kind": "links",
"items": [
{
"kind": "source",
"url": "https://code.acme.com/design-system/src/tokens/color/text.tokens.json",
"label": "Token source file"
},
{
"kind": "documentation",
"url": "https://design.acme.com/tokens/color-text-primary",
"label": "Token documentation"
},
{
"kind": "related",
"url": "https://design.acme.com/tokens/color-text-secondary",
"label": "color-text-secondary"
},
{
"kind": "related",
"url": "https://design.acme.com/tokens/color-text-tertiary",
"label": "color-text-tertiary"
}
]
}
],
"tokenType": "color",
"source": {
"file": "tokens/color.tokens.json",
"path": "color.text.primary"
},
"documentBlocks": [
{
"kind": "purpose",
"useCases": [
{
"description": "When applying color to body text, headings, and form labels on default background surfaces.",
"kind": "positive"
},
{
"description": "When building components that display primary reading content that must adapt across color modes.",
"kind": "positive"
},
{
"description": "When placing text on dark or colored background surfaces.",
"kind": "negative",
"alternative": {
"identifier": "color-text-inverse",
"rationale": "This token is optimized for contrast against light backgrounds. Using it on dark or saturated surfaces will fail contrast requirements."
}
},
{
"description": "When the text is inside a component that supplies its own scoped color tokens (e.g., text on a filled button).",
"kind": "negative",
"alternative": {
"identifier": "color-text-on-action",
"rationale": "Component-scoped tokens account for the specific background they sit on. Applying a general text token to a scoped context risks contrast failures."
}
}
],
"agents": {
"intent": "Clarify when to use the color-text-primary token versus other text color tokens.",
"disambiguation": [
{
"entity": "color-text-secondary",
"distinction": "Use color-text-primary for body text and headings; use color-text-secondary for supplementary or de-emphasized text."
},
{
"entity": "color-text-on-action",
"distinction": "Use color-text-primary on standard surfaces; use color-text-on-action on filled interactive elements like buttons."
}
],
"keywords": [
"when to use",
"text color",
"primary",
"body text"
]
}
},
{
"kind": "guideline",
"items": [
{
"guidance": "Use for all body text, headings, and form labels on default background surfaces.",
"rationale": "A single primary text color ensures visual consistency and meets WCAG 2.1 AA contrast requirements against the system's default background.",
"kind": "encouraged",
"category": "visual-design"
},
{
"guidance": "Do not override this token's value at the component level. Use color-text-secondary or color-text-tertiary for reduced emphasis.",
"rationale": "Overriding the primary text color creates inconsistency. The system provides lower-emphasis text tokens for visual hierarchy.",
"kind": "prohibited",
"category": "visual-design"
},
{
"guidance": "This color meets a 15.3:1 contrast ratio against color-background-default in light mode.",
"rationale": "Exceeds WCAG 2.1 AAA requirements (7:1 for normal text), ensuring readability for users with low vision.",
"kind": "informational",
"category": "accessibility",
"criteria": [
{
"url": "https://www.w3.org/TR/WCAG22/#contrast-minimum",
"kind": "reference"
},
{
"url": "https://www.w3.org/TR/WCAG22/#contrast-enhanced",
"kind": "reference"
}
]
}
],
"agents": {
"intent": "Enforce correct usage rules for the color-text-primary token.",
"constraints": [
{
"rule": "Do not use color-text-primary on colored or image backgrounds without verifying contrast.",
"level": "must-not"
},
{
"rule": "Always pair with a background token from the same surface family.",
"level": "should"
}
],
"keywords": [
"rules",
"contrast",
"pairing",
"surface"
]
}
},
{
"kind": "accessibility",
"wcagLevel": "AAA",
"colorContrast": [
{
"foreground": "color-text-primary",
"background": "color-background-default",
"contrastRatio": 15.3,
"level": "AAA",
"context": "Primary text on default background in light mode."
},
{
"foreground": "color-text-primary",
"background": "color-background-subtle",
"contrastRatio": 13.8,
"level": "AAA",
"context": "Primary text on subtle background (card surface) in light mode."
}
],
"agents": {
"intent": "Provide contrast ratios and WCAG compliance data for the color-text-primary token.",
"keywords": [
"WCAG",
"contrast",
"AA",
"AAA",
"accessibility",
"ratio"
]
}
}
],
"agents": {
"intent": "Apply the primary text color for body content, headings, and labels on default background surfaces.",
"constraints": [
{
"rule": "Do not use on dark or colored background surfaces.",
"level": "must-not"
},
{
"rule": "Do not override this token value at the component level.",
"level": "must-not"
}
],
"disambiguation": [
{
"entity": "color-text-secondary",
"distinction": "Use primary for default reading content; use secondary for supporting or reduced-emphasis text."
},
{
"entity": "color-text-on-action",
"distinction": "Use primary on default surfaces; use on-action inside filled interactive components."
}
],
"keywords": [
"color",
"text",
"primary",
"body",
"heading",
"label",
"foreground"
]
}
}
}