Skip to content

Commit 65ebe6a

Browse files
committed
improvement(docs): finish the platform token sweep
Follow-on within the same PR. A full comparison of every custom token docs rolls against the platform found three more classes of drift. Text scale — #6241 retuned these and docs kept the old values: - `--text-body` #3b3b3b -> #434343 (light), #cdcdcd -> #c1c1c1 (dark) - `--text-muted` #707070 -> #7a7a7a (light), #787878 -> #6e6e6e (dark) - `--text-icon` #525252 -> #5a5a5a (light), #a0a0a0 -> #969696 (dark) Docs and the app now agree on all 62 shared token names, with zero divergent values. Missing shared-component tokens. Docs renders `@sim/emcn` (Badge, Chip, ChipLink) and `@sim/workflow-renderer` (block, subflow and note views), but never defined 14 of the tokens those components reference — an undefined `var()` silently falls back to `currentColor`, so the failure is invisible until the branch that uses it renders. Several are live: `--warning` on an edited subflow, `--caution` on inline code inside a note, `--text-placeholder` on an empty note, `--border-success` on a successful run edge. Added with the app's values, along with `--text-icon-muted` (new in #6241) and the four Badge palettes docs lacked (teal, cyan, pink, blue-secondary), so any variant renders correctly rather than being one prop away from black. Type scale — docs declares micro/xs/caption/small/base/md in `@theme` but 20 call sites bypassed it with identical raw values (`text-[13px]`, `text-[0.8125rem]`, `text-[12px]`, `text-[15px]`, `text-[10px]`). Each now uses the token; every value is byte-identical, so this is a rename, not a restyle. The class reordering in the same files is biome's `useSortedClasses` reacting to the rename — verified as a pure permutation, with the class multiset unchanged in every file. Deliberately left alone: - `#33C482` / `#2FB3FF` — brand-mark SVG fills and default props in demo data, not styling. - The Ask AI button's inverted `#383838`/`#575757`/`#e0e0e0`/`#cfcfcf`. The platform's `--surface-inverted`/`--surface-inverted-hover` hold *different* values, so adopting them would restyle the control rather than tokenize it. Worth doing, but as a visual change with review.
1 parent 60a3115 commit 65ebe6a

10 files changed

Lines changed: 62 additions & 28 deletions

File tree

apps/docs/app/global.css

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ body.wp-lightbox-open [aria-label="Ask Sim"] {
7171
--text-primary: #1a1a1a;
7272
--text-secondary: #525252;
7373
--text-tertiary: #5c5c5c;
74-
--text-body: #3b3b3b;
75-
--text-muted: #707070;
74+
--text-body: #434343;
75+
--text-muted: #7a7a7a;
7676
--text-subtle: #8c8c8c;
77-
--text-icon: #525252;
77+
--text-icon: #5a5a5a;
78+
--text-icon-muted: #5c5c5c;
7879
--text-inverse: #ffffff;
7980
--text-error: #ef4444;
8081
--text-muted-inverse: #a0a0a0;
@@ -87,6 +88,23 @@ body.wp-lightbox-open [aria-label="Ask Sim"] {
8788
--border-muted: var(--border);
8889
--badge-success-bg: #bbf7d0;
8990
--badge-success-text: #15803d;
91+
/* Shared-component tokens: referenced by @sim/emcn and @sim/workflow-renderer.
92+
Undefined here, a var() silently falls back to currentColor. Values mirror
93+
apps/sim/app/_styles/globals.css. */
94+
--border-success: #e0e0e0;
95+
--success: #22c55e;
96+
--error: #dc2626;
97+
--warning: #ea580c;
98+
--caution: #f59e0b;
99+
--text-placeholder: #8d8d8d;
100+
--badge-teal-bg: #99f6e4;
101+
--badge-teal-text: #0f766e;
102+
--badge-cyan-bg: #cffafe;
103+
--badge-cyan-text: #0891b2;
104+
--badge-pink-bg: #fbcfe8;
105+
--badge-pink-text: #be185d;
106+
--badge-blue-secondary-bg: #bae6fd;
107+
--badge-blue-secondary-text: #0369a1;
90108
--badge-blue-bg: #bfdbfe;
91109
--badge-blue-text: #1d4ed8;
92110
--badge-purple-bg: #e9d5ff;
@@ -122,10 +140,11 @@ body.wp-lightbox-open [aria-label="Ask Sim"] {
122140
--text-primary: #e6e6e6;
123141
--text-secondary: #cccccc;
124142
--text-tertiary: #b3b3b3;
125-
--text-body: #cdcdcd;
126-
--text-muted: #787878;
143+
--text-body: #c1c1c1;
144+
--text-muted: #6e6e6e;
127145
--text-subtle: #7d7d7d;
128-
--text-icon: #a0a0a0;
146+
--text-icon: #969696;
147+
--text-icon-muted: #949494;
129148
--text-inverse: #1b1b1b;
130149
--text-error: #ef4444;
131150
--text-muted-inverse: #b3b3b3;
@@ -138,6 +157,23 @@ body.wp-lightbox-open [aria-label="Ask Sim"] {
138157
--border-muted: var(--border);
139158
--badge-success-bg: rgba(34, 197, 94, 0.2);
140159
--badge-success-text: #86efac;
160+
/* Shared-component tokens: referenced by @sim/emcn and @sim/workflow-renderer.
161+
Undefined here, a var() silently falls back to currentColor. Values mirror
162+
apps/sim/app/_styles/globals.css. */
163+
--border-success: #575757;
164+
--success: #22c55e;
165+
--error: #f87171;
166+
--warning: #ff6600;
167+
--caution: #f59e0b;
168+
--text-placeholder: #8d8d8d;
169+
--badge-teal-bg: rgba(20, 184, 166, 0.2);
170+
--badge-teal-text: #5eead4;
171+
--badge-cyan-bg: rgba(14, 165, 233, 0.2);
172+
--badge-cyan-text: #7dd3fc;
173+
--badge-pink-bg: rgba(236, 72, 153, 0.2);
174+
--badge-pink-text: #f9a8d4;
175+
--badge-blue-secondary-bg: rgba(51, 180, 255, 0.2);
176+
--badge-blue-secondary-text: #7dd3fc;
141177
--badge-blue-bg: rgba(59, 130, 246, 0.2);
142178
--badge-blue-text: #93c5fd;
143179
--badge-purple-bg: rgba(168, 85, 247, 0.2);

apps/docs/components/docs-layout/sidebar-components.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const ITEM_BASE =
5656
const ITEM_ACTIVE_MOBILE = 'bg-[var(--surface-active)] font-medium text-[var(--text-primary)]'
5757

5858
const ITEM_DESKTOP =
59-
'lg:mb-[0.0625rem] lg:block lg:rounded-lg lg:px-2.5 lg:py-1.5 lg:font-normal lg:text-[13px] lg:leading-tight'
59+
'lg:mb-[0.0625rem] lg:block lg:rounded-lg lg:px-2.5 lg:py-1.5 lg:font-normal lg:text-small lg:leading-tight'
6060
const ITEM_TEXT = 'lg:text-[var(--text-body)]'
6161
const ITEM_HOVER = 'lg:hover:bg-[var(--surface-3)]'
6262
const ITEM_ACTIVE = 'lg:bg-[var(--surface-active)] lg:font-normal lg:text-[var(--text-body)]'
@@ -144,7 +144,7 @@ export function SidebarFolder({ item, children }: { item: Folder; children: Reac
144144
'flex flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors',
145145
'text-[var(--text-muted)] hover:bg-[var(--surface-active)] hover:text-[var(--text-body)]',
146146
active && ITEM_ACTIVE_MOBILE,
147-
'lg:block lg:flex-1 lg:rounded-lg lg:px-2.5 lg:py-1.5 lg:text-[13px] lg:leading-tight',
147+
'lg:block lg:flex-1 lg:rounded-lg lg:px-2.5 lg:py-1.5 lg:text-small lg:leading-tight',
148148
FOLDER_TEXT,
149149
!active && FOLDER_HOVER,
150150
active && FOLDER_ACTIVE
@@ -171,7 +171,7 @@ export function SidebarFolder({ item, children }: { item: Folder; children: Reac
171171
className={cn(
172172
'flex flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors',
173173
'text-[var(--text-muted)] hover:bg-[var(--surface-active)]',
174-
'lg:flex lg:w-full lg:cursor-pointer lg:items-center lg:justify-between lg:rounded-lg lg:px-2.5 lg:py-1.5 lg:text-left lg:text-[13px] lg:leading-tight',
174+
'lg:flex lg:w-full lg:cursor-pointer lg:items-center lg:justify-between lg:rounded-lg lg:px-2.5 lg:py-1.5 lg:text-left lg:text-small lg:leading-tight',
175175
FOLDER_TEXT,
176176
FOLDER_HOVER
177177
)}
@@ -214,7 +214,7 @@ export function SidebarSeparator({ item }: { item: Separator }) {
214214
<p
215215
className={cn(
216216
'font-medium text-[var(--text-muted)] text-xs',
217-
'lg:font-semibold lg:text-[10px] lg:text-[var(--text-muted)] lg:uppercase lg:tracking-[0.06em]'
217+
'lg:font-semibold lg:text-[var(--text-muted)] lg:text-micro lg:uppercase lg:tracking-[0.06em]'
218218
)}
219219
>
220220
{item.name}

apps/docs/components/page-type-badge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function PageTypeBadge({ type, className }: PageTypeBadgeProps) {
4242
return (
4343
<span
4444
className={cn(
45-
'inline-flex items-center gap-1.5 rounded-md px-[9px] py-0.5 font-medium font-season text-[12px] transition-colors',
45+
'inline-flex items-center gap-1.5 rounded-md px-[9px] py-0.5 font-medium font-season text-caption transition-colors',
4646
config.className,
4747
className
4848
)}

apps/docs/components/ui/search-trigger.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export function SearchTrigger() {
3434
<Search className={chipContentIconClass} />
3535
<span>Search&hellip;</span>
3636
<kbd className='ml-auto flex items-center'>
37-
<span className='text-[15px]'></span>
38-
<span className='text-[12px]'>K</span>
37+
<span className='text-base'></span>
38+
<span className='text-caption'>K</span>
3939
</kbd>
4040
</button>
4141
)

apps/docs/components/ui/video-chapters.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function VideoChapters({ title = 'Chapters', chapters, className }: Video
4343

4444
return (
4545
<aside className={cn('not-prose', className)}>
46-
<p className='mb-2 px-2.5 font-medium text-[0.8125rem] text-[var(--text-muted)]'>{title}</p>
46+
<p className='mb-2 px-2.5 font-medium text-[var(--text-muted)] text-small'>{title}</p>
4747
<ul className='m-0 flex list-none flex-col gap-0.5 p-0'>
4848
{chapters.map((chapter) => (
4949
<li key={chapter.title}>

apps/docs/components/ui/video-placeholder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export function VideoPlaceholder({
143143

144144
{/* Top-right status pill — only until a video is wired up */}
145145
{!hasVideo && (
146-
<span className='absolute top-6 right-6 z-10 inline-flex items-center gap-2 rounded-full border border-[var(--border-1)] bg-[var(--surface-2)] px-4 py-2 font-medium text-[12px] text-[var(--text-secondary)] uppercase tracking-[0.14em] md:top-8 md:right-8 dark:bg-[var(--surface-1)]'>
146+
<span className='absolute top-6 right-6 z-10 inline-flex items-center gap-2 rounded-full border border-[var(--border-1)] bg-[var(--surface-2)] px-4 py-2 font-medium text-[var(--text-secondary)] text-caption uppercase tracking-[0.14em] md:top-8 md:right-8 dark:bg-[var(--surface-1)]'>
147147
<span className='size-1.5 rounded-full bg-[var(--brand-accent)]' />
148148
{label}
149149
</span>

apps/docs/components/ui/what-you-will-learn.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ interface WhatYouWillLearnProps {
1919
export function WhatYouWillLearn({ items, className }: WhatYouWillLearnProps) {
2020
return (
2121
<div className={cn('not-prose', className)}>
22-
<p className='mb-3 font-medium text-[0.8125rem] text-[var(--text-muted)]'>
23-
What you will learn
24-
</p>
22+
<p className='mb-3 font-medium text-[var(--text-muted)] text-small'>What you will learn</p>
2523
<div className='divide-y divide-[var(--border)]'>
2624
{items.map((item) => (
2725
<div key={item.title} className='py-3.5 first:pt-0 last:pb-0'>

apps/docs/components/workflow-preview/block-inspector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function FieldControl({ field }: { field: InspectorField }) {
101101
style={{ left: `calc(${percent}% - 6px)` }}
102102
/>
103103
</div>
104-
<span className='text-[13px] text-[var(--text-primary)]'>{field.value}</span>
104+
<span className='text-[var(--text-primary)] text-small'>{field.value}</span>
105105
</div>
106106
)
107107
}

apps/docs/components/workflow-preview/output-bundle.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function TreeNode({ node, depth = 0 }: { node: OutputNode; depth?: number }) {
6464
<div className='flex min-w-0 flex-col'>
6565
<div className='flex min-h-[26px] items-center gap-2 rounded-[6px] px-1'>
6666
<span
67-
className='text-[13px]'
67+
className='text-small'
6868
style={{ color: node.highlight ? 'var(--brand-secondary)' : 'var(--text-primary)' }}
6969
>
7070
{node.key}
@@ -82,7 +82,7 @@ function TreeNode({ node, depth = 0 }: { node: OutputNode; depth?: number }) {
8282
<TreeNode key={child.key} node={child} depth={depth + 1} />
8383
))
8484
: node.value !== undefined && (
85-
<div className='py-0.5 text-[13px] text-[var(--text-secondary)]'>{node.value}</div>
85+
<div className='py-0.5 text-[var(--text-secondary)] text-small'>{node.value}</div>
8686
)}
8787
</div>
8888
)}
@@ -112,7 +112,7 @@ export function OutputBundle({
112112
<div className='not-prose my-6 flex w-full max-w-[640px] flex-col gap-3'>
113113
<div className='flex overflow-hidden rounded-xl border border-[var(--border)] bg-[var(--surface-1)]'>
114114
<div className='flex w-[210px] flex-shrink-0 flex-col border-[var(--border)] border-r px-2 py-2'>
115-
<div className='px-2 pb-2 text-[12px] text-[var(--text-muted)]'>Logs</div>
115+
<div className='px-2 pb-2 text-[var(--text-muted)] text-caption'>Logs</div>
116116
{logRows.map((row) => {
117117
const Icon = row.type ? resolveIcon(row.type) : null
118118
return (
@@ -127,9 +127,9 @@ export function OutputBundle({
127127
>
128128
{Icon && <Icon className='size-[10px] text-white' />}
129129
</div>
130-
<span className='truncate text-[13px] text-[var(--text-primary)]'>{row.name}</span>
130+
<span className='truncate text-[var(--text-primary)] text-small'>{row.name}</span>
131131
{row.duration && (
132-
<span className='ml-auto text-[12px] text-[var(--text-muted)]'>
132+
<span className='ml-auto text-[var(--text-muted)] text-caption'>
133133
{row.duration}
134134
</span>
135135
)}
@@ -140,8 +140,8 @@ export function OutputBundle({
140140

141141
<div className='flex min-w-0 flex-1 flex-col px-3 py-2'>
142142
<div className='flex items-center gap-3 pb-2'>
143-
<span className='text-[13px] text-[var(--text-primary)]'>Output</span>
144-
<span className='text-[13px] text-[var(--text-muted)]'>Input</span>
143+
<span className='text-[var(--text-primary)] text-small'>Output</span>
144+
<span className='text-[var(--text-muted)] text-small'>Input</span>
145145
<span className='ml-auto flex items-center gap-2 text-[var(--text-subtle)]'>
146146
<Search className='size-[12px]' />
147147
<Clipboard className='size-[12px]' />

apps/docs/components/workflow-preview/workflow-preview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ export function WorkflowPreview({
325325
>
326326
<div className='relative min-w-0 flex-1'>
327327
<div className='pointer-events-none absolute top-0 right-0 left-0 z-10 flex items-center justify-between px-4 py-3'>
328-
<span className='text-[13px] text-[var(--text-muted)]'>{workflow.name}</span>
328+
<span className='text-[var(--text-muted)] text-small'>{workflow.name}</span>
329329
<button
330330
ref={closeButtonRef}
331331
type='button'
@@ -360,7 +360,7 @@ export function WorkflowPreview({
360360
tools={selectedBlock.tools}
361361
/>
362362
) : (
363-
<div className='flex h-full items-center justify-center px-6 text-center text-[13px] text-[var(--text-muted)]'>
363+
<div className='flex h-full items-center justify-center px-6 text-center text-[var(--text-muted)] text-small'>
364364
Select a block to see its full configuration
365365
</div>
366366
)}

0 commit comments

Comments
 (0)