Skip to content

Commit 60a3115

Browse files
committed
improvement(docs): inherit the platform border and font-weight scales
#6241 consolidated the app's neutral border tokens and flattened its font-weight scale. `apps/docs` was carrying an untouched copy of the pre-migration values, so the two have visibly drifted — the docs `@theme` block already declares it "mirrors apps/sim/tailwind.config.ts", so the drift is against stated intent rather than a deliberate divergence. Borders — same consolidation as the app: - `--border` #dedede -> #d8d8d8 (light), #333333 -> #444444 (dark) - `--border-1` and `--border-muted` become aliases of `--border`, so the 19 existing `var(--border-1)` consumers pick up the unified colour without being touched - `--divider` is retired; its single consumer moves to `--border` Font weights — the arbitrary values the app dropped: - `font-[480]`/`font-[470]`/`font-[500]` -> `font-medium`, `font-[430]` -> `font-normal`, `font-[600]` -> `font-semibold` The navbar's active tab and its invisible width-reserving ghost both used `font-[480]`; they move to `font-medium` together, so the anti-layout-shift trick still holds. Deliberately NOT ported: the app's `--border-width` hairline (0.5px on hi-dpi). The app wires it through `borderWidth.DEFAULT` in a Tailwind v3 JS config; docs is Tailwind v4 CSS-first, which hardcodes `border: 1px` in the utility with no theme key, so matching it means overriding a Tailwind utility. That is a site-wide visual change and wants its own PR with visual review. Also unchanged: the inline SVGs. `components/icons.tsx` (328) is the brand and integration set, `sim-logo` is a brand mark, and the handful of remaining shapes are bespoke and positioned by hand. Docs already consumes `@sim/emcn/icons` in the 15 places where a shared icon is the right call, and imports zero lucide.
1 parent 9b9da81 commit 60a3115

5 files changed

Lines changed: 16 additions & 16 deletions

File tree

apps/docs/app/global.css

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ body.wp-lightbox-open [aria-label="Ask Sim"] {
6565
--surface-5: #f3f3f3;
6666
--surface-6: #e5e5e5;
6767
--surface-active: #ececec;
68-
--border: #dedede;
69-
--border-1: #e0e0e0;
70-
--divider: #ededed;
68+
--border: #d8d8d8;
69+
/** Legacy neutral-border aliases. New work should use --border. */
70+
--border-1: var(--border);
7171
--text-primary: #1a1a1a;
7272
--text-secondary: #525252;
7373
--text-tertiary: #5c5c5c;
@@ -84,7 +84,7 @@ body.wp-lightbox-open [aria-label="Ask Sim"] {
8484
--surface-inverted: #1b1b1b;
8585
--surface-inverted-hover: #363636;
8686
--border-inverted: #363636;
87-
--border-muted: #e4e4e4;
87+
--border-muted: var(--border);
8888
--badge-success-bg: #bbf7d0;
8989
--badge-success-text: #15803d;
9090
--badge-blue-bg: #bfdbfe;
@@ -116,9 +116,9 @@ body.wp-lightbox-open [aria-label="Ask Sim"] {
116116
--surface-5: #363636;
117117
--surface-6: #454545;
118118
--surface-active: #2c2c2c;
119-
--border: #333333;
120-
--border-1: #3d3d3d;
121-
--divider: #393939;
119+
--border: #444444;
120+
/** Legacy neutral-border aliases. New work should use --border. */
121+
--border-1: var(--border);
122122
--text-primary: #e6e6e6;
123123
--text-secondary: #cccccc;
124124
--text-tertiary: #b3b3b3;
@@ -135,7 +135,7 @@ body.wp-lightbox-open [aria-label="Ask Sim"] {
135135
--surface-inverted: #242424;
136136
--surface-inverted-hover: #363636;
137137
--border-inverted: #3d3d3d;
138-
--border-muted: #424242;
138+
--border-muted: var(--border);
139139
--badge-success-bg: rgba(34, 197, 94, 0.2);
140140
--badge-success-text: #86efac;
141141
--badge-blue-bg: rgba(59, 130, 246, 0.2);

apps/docs/components/ai/ask-ai-panel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ export function AskAIPanel({ locale, open, onClose }: AskAIPanelProps) {
145145
className={cn(
146146
'space-y-3 text-[var(--text-primary)] text-base leading-relaxed',
147147
'[&_a]:text-[var(--text-primary)] [&_a]:underline [&_a]:decoration-dashed [&_a]:underline-offset-4',
148-
'[&_strong]:font-[600]',
149-
'[&_h1]:font-[600] [&_h2]:font-[600] [&_h3]:font-[600] [&_h4]:font-[600]',
148+
'[&_strong]:font-semibold',
149+
'[&_h1]:font-semibold [&_h2]:font-semibold [&_h3]:font-semibold [&_h4]:font-semibold',
150150
'[&_li]:my-1 [&_ol]:my-3 [&_ol]:list-decimal [&_ol]:pl-5 [&_ul]:my-3 [&_ul]:list-disc [&_ul]:pl-5',
151151
'[&_code]:font-mono [&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-[var(--surface-5)] [&_pre]:p-3 [&_pre]:text-small'
152152
)}

apps/docs/components/navbar/navbar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ export function Navbar() {
7777
className={cn(
7878
'-mb-px relative flex items-center border-b text-[14px] tracking-[-0.01em] transition-colors',
7979
isActive
80-
? 'border-[var(--text-muted)] font-[480] text-[var(--text-primary)]'
81-
: 'border-transparent font-[430] text-[var(--text-muted)] hover:border-[var(--border-1)] hover:text-[var(--text-secondary)]'
80+
? 'border-[var(--text-muted)] font-medium text-[var(--text-primary)]'
81+
: 'border-transparent font-normal text-[var(--text-muted)] hover:border-[var(--border-1)] hover:text-[var(--text-secondary)]'
8282
)}
8383
>
8484
{/* Invisible bold text reserves width to prevent layout shift */}
85-
<span className='invisible font-[480]'>{tab.label}</span>
85+
<span className='invisible font-medium'>{tab.label}</span>
8686
<span className='absolute'>{tab.label}</span>
8787
</Link>
8888
)

apps/docs/components/ui/faq.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function FAQItemRow({
3030
type='button'
3131
onClick={onToggle}
3232
aria-expanded={isOpen}
33-
className='flex w-full cursor-pointer items-center gap-3 px-4 py-2.5 text-left font-[470] text-[0.875rem] text-[var(--text-body)] transition-colors hover:bg-[var(--surface-3)]'
33+
className='flex w-full cursor-pointer items-center gap-3 px-4 py-2.5 text-left font-medium text-[0.875rem] text-[var(--text-body)] transition-colors hover:bg-[var(--surface-3)]'
3434
>
3535
<ChevronRight
3636
className={cn(
@@ -79,7 +79,7 @@ export function FAQ({ items, title = 'Common Questions' }: FAQProps) {
7979
type='application/ld+json'
8080
dangerouslySetInnerHTML={{ __html: serializeJsonLd(faqSchema) }}
8181
/>
82-
<h2 className='mb-4 font-[500] text-xl'>{title}</h2>
82+
<h2 className='mb-4 font-medium text-xl'>{title}</h2>
8383
<div className='border-[var(--border)] border-t border-b'>
8484
{items.map((item, index) => (
8585
<div

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function TreeNode({ node, depth = 0 }: { node: OutputNode; depth?: number }) {
7676
/>
7777
</div>
7878
{expanded && (node.children || node.value !== undefined) && (
79-
<div className='mt-0.5 ml-[5px] flex min-w-0 flex-col gap-0.5 border-[var(--divider)] border-l pl-[10px]'>
79+
<div className='mt-0.5 ml-[5px] flex min-w-0 flex-col gap-0.5 border-[var(--border)] border-l pl-[10px]'>
8080
{node.children
8181
? node.children.map((child) => (
8282
<TreeNode key={child.key} node={child} depth={depth + 1} />

0 commit comments

Comments
 (0)