Skip to content

Commit 86c5119

Browse files
committed
Indent fixes
1 parent c874f85 commit 86c5119

1 file changed

Lines changed: 30 additions & 41 deletions

File tree

docs-intro/concepts.md

Lines changed: 30 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ Before diving into TokenScript, let's establish the core concepts and terminolog
1616

1717
<TokenScriptCodeBlock mode="json" showResult={false}>
1818
{`{
19-
"color.primary": "#0066FF",
20-
"spacing.base": "8px",
21-
"font.size.body": "16px",
22-
"border.radius.small": "4px"
19+
"color.primary": "#0066FF",
20+
"spacing.base": "8px",
21+
"font.size.body": "16px",
22+
"border.radius.small": "4px"
2323
}`}
2424
</TokenScriptCodeBlock>
2525

@@ -58,19 +58,19 @@ Think of them as the **design DNA** of your product - the single source of truth
5858

5959
<TokenScriptCodeBlock mode="json" showResult={false}>
6060
{`{
61-
"spacing.small": "8px",
62-
"spacing.medium": "16px", // must maintain manually
63-
"spacing.large": "24px" // must maintain manually
61+
"spacing.small": "8px",
62+
"spacing.medium": "16px", // must maintain manually
63+
"spacing.large": "24px" // must maintain manually
6464
}`}
6565
</TokenScriptCodeBlock>
6666

6767
**Dynamic (with TokenScript):**
6868

6969
<TokenScriptCodeBlock mode="json" showResult={false}>
7070
{`{
71-
"spacing.small": "8px",
72-
"spacing.medium": "{spacing.small} * 2", // computed!
73-
"spacing.large": "{spacing.medium} * 1.5" // computed!
71+
"spacing.small": "8px",
72+
"spacing.medium": "{spacing.small} * 2", // computed!
73+
"spacing.large": "{spacing.medium} * 1.5" // computed!
7474
}`}
7575
</TokenScriptCodeBlock>
7676

@@ -102,21 +102,10 @@ return large;`}
102102

103103
**Token resolution** is the process of turning token definitions with references into concrete values.
104104

105-
**Before resolution:**
106-
107-
<TokenScriptCodeBlock mode="json" showResult={false}>
108-
{`{
109-
"spacing.base": "8px",
110-
"spacing.large": "{spacing.base} * 2"
111-
}`}
112-
</TokenScriptCodeBlock>
113-
114-
**After resolution:**
115-
116-
<TokenScriptCodeBlock mode="json" showResult={false}>
105+
<TokenScriptCodeBlock mode="json">
117106
{`{
118-
"spacing.base": "8px",
119-
"spacing.large": "16px"
107+
"spacing.base": "8px",
108+
"spacing.large": "{spacing.base} * 2"
120109
}`}
121110
</TokenScriptCodeBlock>
122111

@@ -196,11 +185,11 @@ DTCG is the **emerging standard** for design tokens. TokenScript natively suppor
196185

197186
<TokenScriptCodeBlock mode="json" showResult={false}>
198187
{`{
199-
"spacing-base": {
200-
"$type": "dimension",
201-
"$value": "8px",
202-
"$description": "Base spacing unit"
203-
}
188+
"spacing-base": {
189+
"$type": "dimension",
190+
"$value": "8px",
191+
"$description": "Base spacing unit"
192+
}
204193
}`}
205194
</TokenScriptCodeBlock>
206195

@@ -247,8 +236,8 @@ In this mode, TokenScript resolves expressions embedded in token definitions:
247236

248237
<TokenScriptCodeBlock mode="json" showResult={false}>
249238
{`{
250-
"spacing.base": "8px",
251-
"spacing.large": "{spacing.base} * 2"
239+
"spacing.base": "8px",
240+
"spacing.large": "{spacing.base} * 2"
252241
}`}
253242
</TokenScriptCodeBlock>
254243

@@ -291,10 +280,10 @@ In this mode, TokenScript resolves expressions embedded in token definitions:
291280

292281
<TokenScriptCodeBlock mode="json" showResult={false}>
293282
{`{
294-
"color.brand": "#0066FF",
295-
"color.brandLight": "lighten({color.brand}, 20)",
296-
"spacing.base": "8px",
297-
"spacing.large": "{spacing.base} * 2"
283+
"color.brand": "#0066FF",
284+
"color.brandLight": "lighten({color.brand}, 20)",
285+
"spacing.base": "8px",
286+
"spacing.large": "{spacing.base} * 2"
298287
}`}
299288
</TokenScriptCodeBlock>
300289

@@ -307,10 +296,10 @@ tokenscript parse_json --json tokens.json --output tokens-resolved.json
307296

308297
<TokenScriptCodeBlock mode="json" showResult={false}>
309298
{`{
310-
"color.brand": "#0066FF",
311-
"color.brandLight": "#4D94FF", // Computed!
312-
"spacing.base": "8px",
313-
"spacing.large": "16px" // Computed!
299+
"color.brand": "#0066FF",
300+
"color.brandLight": "#4D94FF", // Computed!
301+
"spacing.base": "8px",
302+
"spacing.large": "16px" // Computed!
314303
}`}
315304
</TokenScriptCodeBlock>
316305

@@ -342,9 +331,9 @@ variable largeSpacing: NumberWithUnit = 8px * scale;
342331
// Functions (token transformations)
343332
variable isDarkMode: Boolean = false;
344333
if (isDarkMode) [
345-
return invert(baseColor);
334+
return invert(baseColor);
346335
] else [
347-
return baseColor;
336+
return baseColor;
348337
]`}
349338
</TokenScriptCodeBlock>
350339

0 commit comments

Comments
 (0)