Open Claude UI
中文
v1 · Claude UI Design Handbook (1.x)

Claude Colors: Hex Values & Design Tokens

Claude colors with exact hex values: clay #D97757, brand #C6613F, canvas #FCFCFB / #151515, plus surface, radius, shadow, font and motion tokens.

中文版Last updated:

📚 Back to the 1.x overview · Next: Chapter 2: Atomic Components & Interactive Controls (Chinese) ➡️


This chapter documents the Claude colors and the rest of the design tokens found in the Claude Desktop 1.x front-end build: the color palette with exact hex values, surfaces, border radius, borders and shadows, the font stack, the type scale and motion curves. It is a translation of the Chinese handbook chapter; every value is copied from it unchanged.

Chapter 1: Design Philosophy & Design Tokens

Technical domain: Design Philosophy & Design Tokens

1.1 Design philosophy and visual tone

Claude's interface stands out among today's AI products. Its core tone comes down to three points:

  1. Editorial Warmth:
    • It drops cold, highly saturated cyberpunk blue and purple entirely. The main brand color is a warm clay (#d97757), on soft off-white / dark gray backgrounds (#fcfcfb / #151515).
  2. Low-contrast Surface Layering:
    • The interface almost never uses hard 1px black borders. Depth comes from tiny lightness differences between the Surface 0 - 3 layers and from semi-transparent outer-ring shadows built with color-mix().
  3. Lightweight Organic Motion:
    • Streaming text uses a GPU-accelerated blur dissolve, complex expansions use CSS Grid 0fr to avoid height jitter, and gesture interactions use real damped springs.

1.2 Surfaces and color scale

Technical domain: Surfaces & Colors

According to a full AST audit of the production bundle c6a992d55-sXiDGMFQ.css with REA (Reverse Engineer Anything) v6.5.0, Claude does not use isolated, scattered color values. Its colors sit on a precise system built from a complete 35-step gray scale (--cds-gray-0 to --cds-gray-900) and a 35-step orange scale (--cds-orange-0 to --cds-orange-900).

graph TD
    S0["Surface 0: sidebar / base layer (Canvas)"]
    S1["Surface 1: main page canvas (Chat Page)"]
    S2["Surface 2: standalone panels / card surfaces (Cards)"]
    S3["Surface 3: composer / popovers / top layer (Overlays)"]
    
    S0 --> S1 --> S2 --> S3
TokenLight modeDark modeBound tokenUsage
--cds-surface-0#f9f9f7#0b0b0bvar(--cds-gray-20) / var(--cds-gray-900)Sidebar background, window root background
--cds-surface-1#fcfcfb#151515var(--cds-gray-10) / var(--cds-gray-850)Main chat canvas background
--cds-surface-2#ffffff#1a1a19var(--cds-gray-0) / var(--cds-gray-830)Message containers, card surfaces
--cds-surface-3#ffffff#20201fvar(--cds-gray-0) / var(--cds-gray-800)Chat composer container, highlighted overlays
--brand#c6613f#c6613fGlobal production brand color on desktopMain brand color of the official desktop app
--cds-clay#d97757#d97757Brand clay primaryThinking pulse dot, spark icon fallback color
--cds-clay-emphasized#cc5a36#cc5a36Clay hover emphasisDarker interactive color on hover
--cds-borderhsla(0, 0%, 8%, 0.10)hsla(0, 0%, 100%, 0.09)var(--cds-alpha-2)General soft border
--cds-border-stronghsla(0, 0%, 8%, 0.20)hsla(0, 0%, 100%, 0.18)var(--cds-alpha-3)Control outer ring, active border

[!TIP] Dark mode 2-level equal stepping (OLED Anti-Banding):
REA's analysis shows that Claude's dark surfaces follow strict, equal hexadecimal steps:
--cds-gray-800 (#20201f) $\to$ 810 (#1e1e1d) $\to$ 820 (#1c1c1b) $\to$ 830 (#1a1a19) $\to$ 840 (#181817) $\to$ 850 (#151515) $\to$ 860 (#131313) $\to$ 870 (#111111) $\to$ 880 (#0f0f0f) $\to$ 890 (#0d0d0d) $\to$ 900 (#0b0b0b).
Each step drops exactly 2 HEX units in lightness, which removes gray banding on OLED screens.


1.3 Control sizes and the border-radius matrix

Technical domain: Border Radius, Heights & Sizing

1.3.1 Border radius hierarchy

In the production styles, the full set of radius tokens and the nesting formula are:

Token / variableExact sizeTailwind classRole and typical components
--radius-xs2px (.125rem)rounded-[2px]Tiny badges, inner dot of the focus ring
--radius-sm (--cds-keycap-radius)4px (.25rem)roundedShortcut badges (Kbd), tiny tags, checkboxes
--radius-md6px (.375rem)rounded-mdExtra-small buttons (XS 26px), prompt suggestion pills
--radius-lg8px (.5rem)rounded-lgStandard buttons (SM/MD), form inputs, dropdown menu items
--cds-panel-radius10pxrounded-[10px]Sub-panel cards, uploaded file attachment entries (.cds-attachment)
--radius-xl12px (.75rem)rounded-xlCode block containers, Artifact preview cards, drawer panels
--radius-2xl16px (1rem)rounded-2xlSystem modal dialogs (ConfirmationDialog), settings cards
--cds-message-bubble-radius18pxrounded-[18px]User message bubble (User Message Bubble)
--cds-radius-composer20pxrounded-[20px]Persistent chat composer at the bottom (Chat Composer Box)
--radius-cardcalc(var(--cds-radius) + 4px * scale)rounded-cardAdaptive concentric radius for nested cards (responds to the scale factor)
--df-radius-pill999pxrounded-fullSegmented control thumb (Segmented Control), status breathing dot

[!IMPORTANT] REA v6.5.0 finding: adaptive concentric radius formula:

--radius-card: calc(var(--cds-radius) + calc(.25rem * var(--cds-rem-scale, 1)));

In Claude, a card's outer curvature is tied to the inner --cds-radius plus .25rem * --cds-rem-scale, so inner and outer corners stay concentric when the user zooms the page or turns on larger accessibility text.


1.3.2 Heights & Sizing

TokenHeight definitionActual pixelsComponents
--cds-h-control--xs1.25rem - 1.5rem20px - 24pxExtra-small buttons, tag close buttons, inline action bars
--cds-h-control--sm1.5rem - 1.75rem24px - 28pxCompact buttons, dropdown triggers
--cds-h-control (default)2rem32pxStandard buttons, icon actions inside inputs, tab navigation items
--cds-h-control--lg2.5rem40pxEmphasized large buttons, primary sign-in / sign-up buttons
--df-titlebarfixed 46px - 48px46px - 48pxDrag bar at the top of the frameless desktop window (Titlebar)
--static-sidebar-width18rem288pxWidth of the persistent desktop sidebar
--chat-max-width42rem / 48rem672px - 768pxCentral conversation width for comfortable reading (max-w-2xl / max-w-3xl)
--composer-max-height24rem384pxMaximum auto-grow height of the composer (scrolls beyond that)

1.4 Hairline borders, soft shadows and avoiding border bloat

Technical domain: Borders, Hairlines & Shadows

1.4.1 Border widths, hairlines and the shadow ladder

In many Claude look-alike products, the "cheap" look comes almost 100% from borders that are too thick and too hard and from single-layer, pure-black shadows. Claude Desktop uses precise rules to avoid this:

1. Border width ladder and Retina hairlines (Border Width & Retina Hairline)

On Retina screens (MacBook Retina @2x/@3x), a standard 1px border actually covers 2 to 3 physical pixels and looks heavy. Claude uses media queries and inset-shadow outlines to get real, dynamic hairlines:

Border levelSpecificationToken / implementationMain components and scenarios
0.5px hairline (Hairline)@media (resolution >= 2x) { 0.5px }--cds-ring-hairline / box-shadow: 0 0 0 0.5px var(--cds-border)Table row dividers, gaps between inactive segmented tabs, secondary tags, very thin pill backgrounds
1.0px structural borderstandard 1px (10% Alpha)--cds-border: var(--cds-alpha-2); (hsla(0, 0%, 8%, 0.1))Card panels, resting composer outline, bottom divider of the top bar, base edge of popovers
1.5px active indicator border1.5px (Accent Ring)box-shadow: inset 0 0 0 1.5px currentColor;Edge of the active segmented pill, current selection indicator, checked radio / checkbox outline
2.0px focus and drop highlight2.0px (Focus Ring & Glow)--cds-shadow-drop-ring: inset 0 0 0 2px var(--cds-clay);Glow when a file is dragged over the composer, keyboard Tab focus ring
/* Extracted from c6a992d55-C0zTICcS.css: hairlines and alpha levels */
:root {
  --cds-alpha-0: hsla(0, 0%, 8%, 0);
  --cds-alpha-1: hsla(0, 0%, 8%, 0.05); /* ghost button hover, skeletons, disabled state */
  --cds-alpha-2: hsla(0, 0%, 8%, 0.10); /* standard border (--cds-border), secondary fill */
  --cds-alpha-3: hsla(0, 0%, 8%, 0.20); /* strong border (--cds-border-strong), control hover */
  --cds-alpha-4: hsla(0, 0%, 8%, 0.35); /* heavy divider */

  --cds-border: var(--cds-alpha-2);
  --cds-border-strong: var(--cds-alpha-3);
  --cds-ring-hairline: 1px;
}

/* Hairline adjustment on Retina screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx), (resolution >= 2x) {
  :root { --cds-ring-hairline: 0.5px; }
}
@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 3dppx), (resolution >= 3x) {
  :root { --cds-ring-hairline: calc(1px / 3); }
}

[!TIP] Why does Claude rarely use CSS border: 1px solid ...?
A regular CSS border counts toward the element's box size, so toggling between active and inactive states can cause a small "1px size jitter and reflow". Claude uses box-shadow: inset 0 0 0 1px ... or box-shadow: 0 0 0 1px ... instead. Shadows sit outside box-model layout, so transitions are jitter-free.


2. Production four-tier ambient shadow ladder (4-Tier Ambient & Elevation Shadow System)

Claude drops single-layer blur shadows entirely and uses a two-layer formula everywhere: [close-range Ambient Occlusion] + [long-range Elevation Diffusion]:

Shadow level (Token)Light mode valuesDark mode valuesMain scenarios
--cds-shadow-sm0 1px 2px 0 rgba(0,0,0,0.05), 0 2px 8px 0 rgba(0,0,0,0.08)0 1px 2px 0 rgba(0,0,0,0.40), 0 2px 8px 0 rgba(0,0,0,0.40)Card panel base, attachment cards; keeps flat surfaces from looking harsh
--cds-shadow-md0 2px 4px 0 rgba(0,0,0,0.05), 0 6px 16px 0 rgba(0,0,0,0.08)0 2px 4px 0 rgba(0,0,0,0.40), 0 6px 16px 0 rgba(0,0,0,0.40)Card hover lift, model selector dropdown, expanded accordions
--cds-shadow-lg0 4px 8px 0 rgba(0,0,0,0.06), 0 12px 28px -2px rgba(0,0,0,0.08)0 4px 8px 0 rgba(0,0,0,0.50), 0 16px 36px -2px rgba(0,0,0,0.40)Global modal confirmation dialogs (Modal Dialog), full-screen artifact preview drawer
--cds-shadow-popoverinset 0 0 0 0px transparent, 0 0 0 1px var(--cds-border), 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08)inset 0 0 0 1px rgba(255,255,255,0.10), 0 0 0 0px transparent, 0 8px 28px rgba(0,0,0,0.65), 0 2px 8px rgba(0,0,0,0.45)Context menus, command popovers, rich-text toolbars
--cds-panel-shadow0 0 0 1px var(--cds-border), var(--cds-shadow-sm)0 0 0 1px var(--cds-border), var(--cds-shadow-sm)Standard standalone panel shell (border and soft shadow bound together)

3. The optics of the dual-ring popover (Dual-Ring Architecture)

Pay close attention to how --cds-shadow-popover differs between light and dark mode:

  • Light mode: the outer ring is 0 0 0 1px var(--cds-border), a fine outline around the edge, combined with a soft diffuse shadow that drops 8px.
  • Dark mode (the bevel highlight flips!): the outer ring becomes 0px (no harsh white frame on a black background), and an inner inset 0 0 0 1px rgba(255, 255, 255, 0.10) is added. Like a beveled edge catching faint light from above, it outlines the popover without looking like a border.

4. Composer dual-ring shadow formula (Composer Dual-Ring Shadow)

The composer is the signature element of the Claude interface:

/* Resting (not focused) */
box-shadow: 
  0 4px 20px rgba(0, 0, 0, 0.035),
  inset 0 0 0 1px var(--cds-border);

/* Hover */
box-shadow: 
  0 4px 24px rgba(0, 0, 0, 0.06),
  inset 0 0 0 1px var(--cds-border-strong);

/* Focus-Within */
box-shadow: 
  0 4px 24px rgba(0, 0, 0, 0.08),
  inset 0 0 0 1px var(--cds-border-strong),
  0 0 0 1px var(--cds-border-strong);

5. Global focus ring (Triple-Layer Focus Ring)

When a control is activated by keyboard or click, Claude never uses the operating system's default blue outline. It renders its own three-layer clay ring:

--cds-focus-shadow: 
  inset 0 0 0 1px var(--cds-surface-1),    /* layer 1: 1px spacer between the control and the glow */
  0 0 0 1.5px var(--cds-clay),             /* layer 2: 1.5px clay brand focus ring */
  0 0 6px 1px rgba(217, 119, 87, 0.25);    /* layer 3: soft outer clay glow */

6. Hover states and micro-feedback (Interactive Hover & Micro-Feedback)

Claude's interaction feedback is smooth and restrained, following a "noticeable but never distracting" principle:

  1. Ghost button hover and press (Ghost Button Feedback):
    • Resting: fully transparent background, secondary gray text (var(--cds-text-secondary)).
    • Hover: within 150ms on a Bézier curve (cubic-bezier(0.16, 1, 0.3, 1)) the background fades to a 5% gray fill (var(--cds-fill-ghost-hover)) and the text lights up to the primary color.
    • Active Press: a light scale(0.98) press, and the fill deepens to 10% gray (var(--cds-fill-ghost-selected)).
  2. Card Elevation Y-Lift:
    • Resting: flat on the canvas with --cds-panel-shadow.
    • Hover: lifts by transform: translateY(-1.5px), the shadow transitions smoothly to --cds-panel-shadow-hover, and the border darkens to --cds-border-strong.
    • Leave: settles smoothly back into place with no hard bounce.
  3. Dropdown Row Highlight:
    • When the pointer moves over a menu item, the background instantly lights up as a light highlight pill with a 4px radius (var(--radius-sm)); the row's icon and shortcut light up with it.
  4. Drag & Drop Target Glow:
    • When a dragged file approaches the composer, the composer shows an inner clay glow inset 0 0 24px -2px rgba(217, 119, 87, 0.20) together with an inset 0 0 0 2px var(--cds-clay) snap ring.

1.4.2 Border philosophy and avoiding border bloat (Borders vs. Borderless Architecture)

In modern web front-ends and LLM-generated UI, "Russian-doll borders" are the most common cause of bloated, heavy, amateur-looking interfaces. Many models treat "visual grouping" in a product brief as CSS border border-neutral-200, producing cards inside cards, framed messages, framed toolbars, and a frame around every button inside the input. The eye is cut up by countless gray lines.

Claude Desktop's airy, editorial look comes from a strict minimal-border, low-contrast-surface architecture:

1. The core rule: one closed border (The 1-Border Rule)

  • Depth of sight: along any line of sight from the main canvas inward, you may cross at most 1 closed rectangular border.
  • Automatic downgrade inside containers: once an outer container is already a bordered object (such as the Chat Composer, a Modal, or a Code Block), none of its child controls (buttons, input areas, tags, toolbars) may use a closed border again:
    • Secondary buttons: never border border-neutral-300; use a soft fill based on Surface-2 (bg-neutral-100 hover:bg-neutral-200/80 dark:bg-neutral-800 border-0).
    • Toolbar buttons and inline actions: must be downgraded to the Ghost variant (fully transparent at rest, bg-transparent border-0, with only a faint background on hover, hover:bg-neutral-100/70).
    • Inner input field: the text field inside the Composer has no native border or highlight ring at all (border-0 outline-none ring-0 bg-transparent).

2. Boundary decision matrix (The Boundary Decision Matrix)

Boundary typeRuleTypical production componentsCSS implementation
🚫 Strictly BorderlessGroup with whitespace, text hierarchy or plain background color; no outlines that interrupt reading• AI assistant reply text• User message bubble (#f0f4f8)• All secondary action buttons inside containers• Sidebar / navigation items• Reaction bar under messages• Expanded thinking textborder-0bg-transparent or bg-[#f0f4f8] rounded-[18px]
📦 Mandatory Closed BorderSelf-contained objects with their own interaction sandbox, physical objects, or overlays on the Z axis• Persistent chat composer (Composer)• Syntax-highlighted code block (Code Sandbox)• Standalone file attachment card (.cds-attachment)• Standalone Artifact card• Modal dialog (Dialog)• Context menu (ContextMenu)border border-neutral-200/90 dark:border-neutral-800with a diffuse two-layer shadow
➖ Hairline DividerFor structure inside a container; never nested closed boxes, always a 1px one-sided line• Seam between a code block's language bar and code area (border-b)• Separation between groups in dropdown and context menus (border-t)• Seam between left and right desktop panes (border-r)• Seam between the Composer input and its bottom toolbar (border-t)border-b border-neutral-200/60or border-t border-neutral-100
🌓 Dark Mode 0.5px ChamferA solid 1px white line on a dark background glows harshly; use an inset shadow that imitates a hardware bevel highlight instead• Outer edges of all dark-mode cards, code blocks and overlaysbox-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);or color-mix(in srgb, var(--cds-border) 30%, transparent)

3. Refactoring "Russian-doll borders": before and after

Anti-pattern (bloated output common in AI models):
<!-- ❌ Wrong: 4 nested borders, heavy and oppressive -->
<div class="border border-gray-300 p-4"> <!-- box 1: outer card -->
  <div class="border border-gray-200 p-3"> <!-- box 2: assistant bubble -->
    <p>Reply text</p>
    <div class="border border-gray-300 p-1"> <!-- box 3: small action-bar card -->
      <button class="border border-gray-400">Copy</button> <!-- box 4: bordered button -->
    </div>
  </div>
</div>
Correct pattern (Claude production standard):
<!-- ✅ Right: single border, minimal and airy -->
<div class="p-4"> <!-- main canvas Surface 0, no frame -->
  <div class="space-y-2"> <!-- assistant message: no frame, no fill, sits directly on the canvas -->
    <p class="text-neutral-800 dark:text-neutral-200 leading-relaxed">Reply text</p>
    <div class="flex items-center gap-1 text-neutral-400"> <!-- action bar, no frame -->
      <button class="p-1 rounded-md hover:bg-neutral-100 dark:hover:bg-neutral-800 border-0"> <!-- pure ghost hover -->
        <CopyIcon className="size-3.5" />
      </button>
    </div>
  </div>

4. Scroll-driven fade mask system (Scroll-Driven 28px Fade System)

When conversations and code blocks scroll, a typical front-end just overlays a plain opacity gradient, so text is cut off abruptly at the top and bottom. REA v6.5.0 extracted Claude's complete scroll-timeline-driven mask (Scroll-Driven Fade) specification from the production bundle:

  • Core width: --cds-scroll-fade-size: 28px; (defined as exactly 28px, not an approximate 24px or 32px).
  • 4-Stop Relative Color Fade: The mask is not a solid color. It uses modern CSS color-mix() and rgb(from ...) to take the current background color and fade it in 4 non-linear steps:
    /* Extracted from the real production definition in c6a992d55-sXiDGMFQ.css */
    --cds-scroll-fade-mask: linear-gradient(
      to bottom,
      var(--cds-scroll-fade-strip-color, var(--cds-surface-1)) 0%,
      rgb(from var(--cds-scroll-fade-strip-color, var(--cds-surface-1)) r g b / .85) 13%,
      rgb(from var(--cds-scroll-fade-strip-color, var(--cds-surface-1)) r g b / .50) 40%,
      rgb(from var(--cds-scroll-fade-strip-color, var(--cds-surface-1)) r g b / .15) 70%,
      transparent 100%
    );
    Combined with the native scroll timeline (scroll-timeline), the mask collapses to zero (0px) when the list is at the top and opens up to 28px once it scrolls away from the top. It runs entirely on the GPU compositor with zero main-thread cost.

1.5 Typography and icon alignment constraints

Technical domain: Typography, Alignment & Icons

Claude Desktop tunes font weights, line wrapping and vector icon alignment with near-obsessive care, across six core engineering constraints:

1. Real font stacks and variable font axes (Font Stacks & Variable Axes)

Based on REA v6.5.0's analysis of c6a992d55-sXiDGMFQ.css, Claude has a complete CJK and multilingual fallback chain:

  • CJK sans-serif fallback chain (--font-cjk-sans-fallback):
    --font-cjk-sans-sc: "PingFang SC";
    --font-cjk-sans-tc: "PingFang TC";
    --font-cjk-sans-jp: "Hiragino Sans";
    --font-cjk-sans-kr: "Apple SD Gothic Neo";
    --font-cjk-sans-fallback: var(--font-cjk-sans-sc), var(--font-cjk-sans-tc), var(--font-cjk-sans-jp), var(--font-cjk-sans-kr);
  • Main sans-serif stack (--font-anthropic-sans):
    --font-sans-fallbacks: system-ui, "Segoe UI", Roboto, Helvetica, Arial, var(--font-cjk-sans-fallback), sans-serif;
    --font-anthropic-sans: "anthropic-sans", var(--font-sans-fallbacks);
  • Serif stack for greetings and body text (--font-anthropic-serif):
    --font-anthropic-serif: "anthropic-serif", ui-serif, Georgia, "Times New Roman", var(--font-cjk-sans-fallback), serif;
  • Monospace code stack (--font-anthropic-mono):
    --font-anthropic-mono: "anthropic-mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  • Variable font optical size (opsz) and badge weight (wght):
    --font-opsz-axis-title: "opsz" 28,;
    --font-opsz-axis-heading: "opsz" 20,;
    --font-opsz-axis-display: "opsz" 48,;
    --cds-badge-x-wght: 577.8; /* sub-pixel optical weight for badges */

2. 7-tier font size and line height scale (7-Tier Font Size & Leading Scale)

Claude Desktop has a 7-step type scale designed for dense information, and uses the desktop optical scale factor --cds-rem-scale: calc(16 / 17) (≈ 0.941176) to scale the web default 17px base smoothly down to an exact 16px on native Retina screens.

Tier (Token)CSS expression (Rem Scale)Pixels (Desktop)Line height (Leading)RatioMain content
captioncalc(0.6875rem * var(--cds-rem-scale))10.35px (about 11px)1rem (16px)1.55Shortcut badges (Kbd), message timestamps, model version labels, token usage counts
footnotecalc(0.75rem * var(--cds-rem-scale))11.29px (about 12px)calc(0.9375rem * scale) (14.1px)1.25Attachment file sizes, image metadata, secondary helper text, disclaimers
codecalc(0.75rem * var(--cds-rem-scale))11.29px (about 12px)1rem (16px)1.42Syntax-highlighted code, inline code, internal Thinking logs, diffs
bodycalc(0.8125rem * var(--cds-rem-scale))12.24px (about 13px / 14px)1.125rem (18px)1.46Assistant replies, user bubble text, text and placeholder in the main Composer
prose0.875rem - 1rem (comfortable reading)14.0px - 16.0px1.25rem - 1.5rem (20px - 24px)1.43 - 1.50Long-form Artifacts, in-depth Markdown reading, document previews
headingcalc(0.875rem * var(--cds-rem-scale))13.18px (about 14px / 15px)calc(1.125rem * scale) (17px)1.29Modal titles (Modal Title), card section titles, sidebar group titles, setting names
titlecalc(1.25rem * var(--cds-rem-scale))18.82px (about 20px / 21px)calc(1.5rem * scale) (23.5px)1.25Conversation header title, Project titles, workspace navigation header
/* Extracted from c6a992d55-C0zTICcS.css: core typography variables */
:root {
  --cds-rem-scale: calc(16 / 17); /* desktop optical adjustment factor ≈ 0.94117647 */

  --cds-font-size-caption: calc(0.6875rem * var(--cds-rem-scale, 1));
  --cds-leading-caption: 1rem;

  --cds-font-size-footnote: calc(0.75rem * var(--cds-rem-scale, 1));
  --cds-leading-footnote: calc(0.9375rem * var(--cds-rem-scale, 1));

  --cds-font-size-code: calc(0.75rem * var(--cds-rem-scale, 1));
  --cds-leading-code: 1rem;

  --cds-font-size-body: calc(0.8125rem * var(--cds-rem-scale, 1));
  --cds-leading-body: 1.125rem;

  --cds-font-size-prose: 0.875rem;
  --cds-leading-prose: 1.25rem;

  --cds-font-size-heading: calc(0.875rem * var(--cds-rem-scale, 1));
  --cds-leading-heading: calc(1.125rem * var(--cds-rem-scale, 1));

  --cds-font-size-title: calc(1.25rem * var(--cds-rem-scale, 1));
  --cds-leading-title: calc(1.5rem * var(--cds-rem-scale, 1));
}

3. Dark mode weight compensation for irradiation (Retinal Irradiation Compensation)

In optics and human perception, bright white text on a black background appears to spread outward (the Irradiation Phenomenon), so text of the same weight looks 10% - 15% heavier in dark mode than in light mode, with swollen, blurry edges.

Claude compensates through its proprietary variable font axis: in dark mode it lowers the weight value by 30 - 40 units, so text looks exactly as thin and sharp to the eye as it does in light mode.

Semantic weightLight mode weightReduced dark mode weightCompensation and amount
Regular (body text)font-weight: 400 / "wght" 400--cds-font-axis-wght: "wght" 360Thinned by 40 units, removing the glow of pure-white body text
Medium (actions / emphasis)font-weight: 500 / "wght" 500--cds-font-axis-wght: "wght" 460Thinned by 40 units, keeping medium weight crisp
Semibold (titles / identity)font-weight: 580 / "wght" 580--cds-font-axis-wght: "wght" 550Thinned by 30 units, so bold text doesn't smear on dark backgrounds
Bold (warnings / strong emphasis)font-weight: 600 / "wght" 660--cds-font-axis-wght: "wght" 660Keeps a firm, prominent edge
/* Extracted from the analyzed source c6a992d55-C0zTICcS.css */
/* Light mode baseline */
.font-normal {
  --cds-font-axis-wght: "wght" 400;
  font-variation-settings: var(--font-opsz-axis,) var(--cds-font-axis-wght,) "GRAD" var(--cds-font-grad, 0);
}
.font-medium {
  --cds-font-axis-wght: "wght" 500;
  font-variation-settings: var(--font-opsz-axis,) var(--cds-font-axis-wght,) "GRAD" var(--cds-font-grad, 0);
}
.font-semibold {
  --cds-font-axis-wght: "wght" 580;
  font-variation-settings: var(--font-opsz-axis,) var(--cds-font-axis-wght,) "GRAD" var(--cds-font-grad, 0);
}

/* Dark mode optical compensation */
[data-theme=claude][data-mode=dark] .font-normal {
  --cds-font-axis-wght: "wght" 360;
}
[data-theme=claude][data-mode=dark] .font-medium {
  --cds-font-axis-wght: "wght" 460;
}
[data-theme=claude][data-mode=dark] .font-semibold {
  --cds-font-axis-wght: "wght" 550;
}
[data-theme=claude][data-mode=dark] .font-bold {
  --cds-font-axis-wght: "wght" 660;
}

4. Typography matrix for core content areas (Content-to-Typography Matrix)

To stop font sizes and weights from being invented ad hoc or stacked arbitrarily, the table below lists the standard font parameters for every core module of Claude Desktop:

ModuleContent elementFont familyTier / sizeLine heightWeight (Light / Dark)Notes
Conversation (Chat)Assistant name ("Claude")Sans12px16px580 / 550 (Semibold)Stable identity label at the top
Model version badge ("3.7 Sonnet")Mono10.5px (Caption)14px500 / 460 (Medium)Pill badge, monospace letters
Message timestamp ("09:42")Mono11px (Footnote)14px400 / 360 (Regular)tabular-nums, low-contrast text
Assistant reply (Paragraph)Sans14px (Body)20px (1.428)400 / 360 (Regular)text-wrap: pretty; removes orphaned single words
Text in user bubblesSans14px (Body)20px (1.428)400 / 360 (Regular)Tight wrapping, natural line breaks
Message action bar (copy / regenerate buttons)Sans12px16px500 / 460 (Medium)Secondary buttons that fade in on hover
ThinkingThinking toggle ("Thought for 5.2s")Sans12px16px500 / 460 (Medium)Includes an inline rotating arrow and live timer
Raw reasoning log (Raw Thought)Mono11.5px (Code)16px (1.39)400 / 360 (Regular)Thin monospace stream, no background, muted gray text
Input area (Composer)Multi-line text input (Textarea)Sans14px (Body)20px (1.428)400 / 360 (Regular)Mobile minimum max(16px, 14px)
Placeholder text (Placeholder)Sans14px (Body)20px (1.428)400 / 360 (Regular)45% opacity color
Bottom helper action ("+ Add content")Sans12px16px500 / 460 (Medium)Compact toolbar button
Model selector dropdown ("Claude 3.7 Sonnet")Sans12px16px500 / 460 (Medium)Pill-shaped control
Send button ("Send" / icon)Sans12px16px580 / 550 (Semibold)Visual focal weight
Code and ArtifactsSyntax-highlighted code (Code block)Mono12px (Code)17.5px (1.46)400 / 360 (Regular)tabular-nums; smooth horizontal scrolling
Inline code (inline code)Mono12px (Code)14px500 / 460 (Medium)1px fine border, 3px radius, 1px 4px padding
Artifact card title (Artifact Title)Sans13px (Heading)18px580 / 550 (Semibold)Click to open the full-screen artifact drawer
Artifact language tag ("REACT", "HTML")Mono10.5px (Caption)12px500 / 460 (Medium)Uppercase monospace, letter spacing letter-spacing: 0.05em
Attachment card file nameSans12px16px500 / 460 (Medium)Truncated with text-overflow: ellipsis;
Attachment card file size ("24.8 KB")Mono10.5px (Caption)14px400 / 360 (Regular)tabular-nums, muted helper gray
Controls and dialogs (Controls)Modal dialog title (Modal Dialog)Sans15px - 16px20px (1.25)580 / 550 (Semibold)text-wrap: balance; centered or left-aligned
Segmented control label (Segmented Tab)Sans12px16pxregular 400 / active 500Pill thumb slides behind the label
Button (Button SM / 32px)Sans12.5px16px500 / 460 (Medium)Compact control actions
Button (Button MD / 38px)Sans13.5px18px500 / 460 (Medium)Standard primary and secondary page buttons
Shortcut keycap (Kbd)Mono10px - 11px12px580 / 550 (Semibold)Shadowed base, compact glyphs

5. Optical baseline for inline icons (.align-[-0.125em])

On the web, inline SVGs and icons sit on vertical-align: baseline by default, so the icon's visual center sits noticeably above the x-height of lowercase letters and the cap height of capitals, and the icon looks like it is floating.

Claude enforces dedicated negative-offset utility classes:

  • .align-[-0.125em] (vertical-align: -0.125em;): for 14px - 16px Body and Heading text. It drops the icon by exactly 1/8em (about 1.75px - 2px), so the icon's center lines up 100% with the letters' visual center.
  • .align-[-0.075em] (vertical-align: -0.075em;): for 11px - 12px Caption and helper text.
  • .align-[-1px] / .align-[-2px]: for inline badges in fixed-height (32px/46px) toolbars and title bars.
/* Extracted from c6a992d55-C0zTICcS.css */
.align-\[-0\.125em\] { vertical-align: -.125em; }
.align-\[-0\.075em\] { vertical-align: -.075em; }
.align-\[-1px\] { vertical-align: -1px; }

4. Text wrapping and break constraints (Text-Wrap & Word-Break Constraints)

  • Balanced heading lines (text-wrap: balance): All :is(h1, h2, h3, h4) and card titles get text-wrap: balance;, which distributes words across lines so the last line never holds a single lonely word.
  • No orphans in body text (text-wrap: pretty): Body paragraphs :is(p, li, dd, blockquote) get text-wrap: pretty;, which prevents a single word being left on the last line (Typographic Runts).
  • Safe wrapping for long strings and tokens (overflow-wrap: anywhere): Tooltips that contain very long model IDs (such as claude-3-7-sonnet-20250219-thinking-exp), Git commit hashes or code variable names strictly use:
    overflow-wrap: anywhere;
    word-break: normal;
    Normal English and Chinese words stay intact (no forced breaks inside regular words), while overlong strings still wrap safely and never overflow the container.
  • Minimum input size on mobile to prevent zoom:
    input, textarea, select {
      font-size: max(16px, var(--cds-font-size-body));
    }
    In iOS WebKit, focusing any input with font-size < 16px forces the page to zoom. Claude sets a 16px floor to avoid this completely.

5. Tabular numerals (Tabular Numerics)

Every area with changing numbers (Thinking duration 00:03.2, token usage 1,284 tokens, dates and tables) is set to:

font-variant-numeric: tabular-nums;
/* or */
font-feature-settings: "tnum" 1;

This makes the digits 0 to 9 all the same width, so the line doesn't jitter as numbers count up.

6. Vector icon architecture and the duotone protocol (Phosphor & Duotone Layering)

  • Native coordinate system: viewBox="0 0 256 256" (Phosphor Icons architecture).
  • Standard and code weights:
    • Regular state: Stroke 16px (weight 533.3, regular thickness).
    • Active / code state: Stroke 24px (weight 700, --df-app-switch-code-weight: 700).
  • Duotone protocol:
    <span data-cds="Icon">
      <!-- primary layer: foreground color -->
      <path data-cds-icon-layer="primary" fill="currentColor" />
      <!-- secondary layer: 45% opacity underlay -->
      <path data-cds-icon-layer="secondary" fill="color-mix(in srgb, currentColor 45%, transparent)" />
    </span>
  • Size ladder:
    • XS (12px): badges, small close icons
    • SM (14px): dense action bar buttons
    • MD (16px): standard interactive elements, using the formula calc(1rem * var(--cds-rem-scale, 1)) ≈ 15.06px - 16px
    • LG (20px): primary card action buttons
    • XL (24px): modals and empty-state illustrations

7. Full typography role scale (Typography Role Scale Hierarchy)

Claude defines atomic classes bound to each semantic UI role, with a base font size, proportional line height and variable font optical tuning built in:

Semantic classSize (font-size)Line height (line-height)Default weight (font-weight)Optical tuning (font-variation-settings)Use
.text-caption-regularcalc(0.6875rem * scale) (about 11px)calc(1.0625rem * scale) (about 17px)Regular (400)"GRAD" 0Timestamps, small footnotes, tiny badges
.text-caption-mediumcalc(0.6875rem * scale) (about 11px)calc(1.0625rem * scale) (about 17px)Medium (470 / 460)"wght" 460 (Dark)Compact status tags, count badges
.text-caption-boldcalc(0.6875rem * scale) (about 11px)calc(1.0625rem * scale) (about 17px)Bold (700 / 660)"wght" 660 (Dark)Emphasized small tags, shortcut hints
.text-footnote-mediumcalc(0.8125rem * scale) (about 13px)calc(1.0625rem * scale) (about 17px)Medium (470 / 460)"wght" 460 (Dark)List item subtitles, secondary sidebar text
.text-footnote-semiboldcalc(0.8125rem * scale) (about 13px)calc(1.0625rem * scale) (about 17px)Semibold (600 / 560)"wght" 560 (Dark)Sidebar headers for active conversation groups
.text-body-regularcalc(0.875rem * scale) (about 14px)calc(1.25rem * scale) (about 20px)Regular (400)"GRAD" 0Standard chat text, settings form text
.text-body-mediumcalc(0.875rem * scale) (about 14px)calc(1.25rem * scale) (about 20px)Medium (470 / 460)"wght" 460 (Dark)Button text, regular interactive links
.text-body-boldcalc(0.875rem * scale) (about 14px)calc(1.25rem * scale) (about 20px)Bold (700 / 660)"wght" 660 (Dark)Emphasized body text (<b>, <strong>)
.text-heading-regularcalc(0.9375rem * scale) (about 15px)calc(1.25rem * scale) (about 20px)Regular (400)"opsz" 20Conversation turn headers, small card titles
.text-heading-semiboldcalc(0.9375rem * scale) (about 15px)calc(1.25rem * scale) (about 20px)Semibold (600 / 560)"opsz" 20, "wght" 560Card titles, dialog panel group names
.text-title-mediumcalc(1.25rem * scale) (about 20px)calc(1.75rem * scale) (about 28px)Medium (500 / 460)"opsz" 28, "wght" 460Page-level titles, large settings sections
.text-title-boldcalc(1.25rem * scale) (about 20px)calc(1.75rem * scale) (about 28px)Bold (700 / 660)"opsz" 28, "wght" 660Primary modal titles
.font-display2.375rem (38px)1.2 (45.6px)Light (wght: 330)"opsz" 48 (Serif axis)Large greeting headline on the first screen (Serif Greeting)

8. Multi-line truncation scale (Multi-line Truncation & Clamp Scale)

Claude uses a specific -webkit-line-clamp scale for cards and bubbles, together with overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical;:

/* 1. Sidebar conversation titles (single line, never overflows) */
.line-clamp-1 {
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  overflow: hidden;
}

/* 2. Thinking card summary (two-line preview) */
.line-clamp-2 {
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  overflow: hidden;
}

/* 3. System prompt cards and model descriptions (three-line preview) */
.line-clamp-3 {
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
}

1.6 Motion tokens and the full set of easing curves

Technical domain: Motion Tokens & Physical Curves

graph LR
    T1["60ms: Micro"] --> T2["120ms: Snap"] --> T3["200ms: Base"] --> T4["300ms: Sheet"] --> T5["450ms: Slow"]

1. Duration Tokens

  • --cds-dur-fast: 60ms (micro-interactions, focus ring show / hide)
  • --cds-dur-snap: 120ms (snapping toggles, badge activation)
  • --cds-dur-base: 200ms (standard control hover and background transitions)
  • --cds-dur-sheet: 300ms (drawer slide-in, conversation viewport pin tracking)
  • --cds-dur-slow: 450ms (ambient transitions, modal rise and fall)

2. The real Bézier easing curves found by REA v6.5.0 (The 7 Core Physical Curves)

REA's full CSS scan of the official production bundle shows that Claude does not have just 3 generic curves. It tunes a dedicated damping constant for each interaction scenario:

Curve token / expressionOfficial componentsPhysical character and visual effect
--cds-ease-swiftcubic-bezier(.16, 1, .3, 1)Ghost buttons, card hover lift (Ghost/Card Hover)iOS-style nimble micro-interaction: arrives quickly in 150ms and stops sharply with no trailing motion
--cds-ease-expandcubic-bezier(.19, 1, .22, 1)Thinking collapse drawer (.timeline-expand)Smooth expansion for CSS Grid: removes any height step or reflow when expanding from 0fr to 1fr
--cds-ease-entercubic-bezier(.22, 1, .36, 1)Message entrance dissolve (timeline-block-enter)From translateY(5px) scale(0.9) blur(4px) to fully sharp and flat
--cds-ease-overshootcubic-bezier(.34, 1.3, .64, 1)Pill thumb, small pill morphs (Pill/Slider)Classic jelly bounce: overshoots by +30% in the first 100ms, settles softly over the next 140ms
--cds-ease-popcubic-bezier(.34, 1.56, .64, 1)Dialog pop, strong action emphasis (Dialog Pop)Stiff spring feedback: a sharp +56% overshoot that feels solid on impact
--cds-ease-pulsecubic-bezier(.4, 0, .2, 1)Quiet three-dot thinking bounce (timeline-quiet-dot)1.9s loop, light translateY(-2.5px) rhythm that eases the feeling of waiting
--cds-ease-risecubic-bezier(.3, .7, .4, 1)Status line rising in (timeline-status-rise)Rises steadily from translateY(6px) -> 0 without stealing focus from the main text
--cds-ease-fallcubic-bezier(0, 0, .2, 1)Status line fading out downward (timeline-status-fall)Accelerates out via translateY(-4px) for a clean exit

📚 1.x overview · Chapter 2: Atomic Components & Interactive Controls (Chinese) ➡️ · Live React chat UI demos

Open Claude UI is an unofficial community analysis, MIT licensed. Claude is a trademark of Anthropic; this project is not affiliated with Anthropic.

On this page

Chapter 1: Design Philosophy & Design Tokens1.1 Design philosophy and visual tone1.2 Surfaces and color scale1.3 Control sizes and the border-radius matrix1.3.1 Border radius hierarchy1.3.2 Heights & Sizing1.4 Hairline borders, soft shadows and avoiding border bloat1.4.1 Border widths, hairlines and the shadow ladder1. Border width ladder and Retina hairlines (Border Width & Retina Hairline)2. Production four-tier ambient shadow ladder (4-Tier Ambient & Elevation Shadow System)3. The optics of the dual-ring popover (Dual-Ring Architecture)4. Composer dual-ring shadow formula (Composer Dual-Ring Shadow)5. Global focus ring (Triple-Layer Focus Ring)6. Hover states and micro-feedback (Interactive Hover & Micro-Feedback)1.4.2 Border philosophy and avoiding border bloat (Borders vs. Borderless Architecture)1. The core rule: one closed border (The 1-Border Rule)2. Boundary decision matrix (The Boundary Decision Matrix)3. Refactoring "Russian-doll borders": before and afterAnti-pattern (bloated output common in AI models):Correct pattern (Claude production standard):4. Scroll-driven fade mask system (Scroll-Driven 28px Fade System)1.5 Typography and icon alignment constraints1. Real font stacks and variable font axes (Font Stacks & Variable Axes)2. 7-tier font size and line height scale (7-Tier Font Size & Leading Scale)3. Dark mode weight compensation for irradiation (Retinal Irradiation Compensation)4. Typography matrix for core content areas (Content-to-Typography Matrix)5. Optical baseline for inline icons (.align-[-0.125em])4. Text wrapping and break constraints (Text-Wrap & Word-Break Constraints)5. Tabular numerals (Tabular Numerics)6. Vector icon architecture and the duotone protocol (Phosphor & Duotone Layering)7. Full typography role scale (Typography Role Scale Hierarchy)8. Multi-line truncation scale (Multi-line Truncation & Clamp Scale)1.6 Motion tokens and the full set of easing curves1. Duration Tokens2. The real Bézier easing curves found by REA v6.5.0 (The 7 Core Physical Curves)