Match the shipped styling to the Claude Design drafts
An audit of all twelve draft files against the build turned up a set of mismatches, most of them in the tier-2 token layer rather than in any one component. Tier 1 is untouched throughout - only the meanings moved. SHAPE. The drafts draw three corners, not five: 2px for a tag, thumbnail, flag or checkbox, 4px for anything with a box, and fully round for a filter chip or status pill. Nothing in any draft is 8px or 12px. --radius-card and --radius-surface therefore come down to radius/sm, a --radius-chip is added for the 2px tier, and --radius-control-lg - a quirk of the Figma Button frame's ghost cells - is retired along with its four consumers. ELEVATION. A shadow is a fraction of the ground it falls on, and the ramp was tuned for a white page: on the drafts' near-black ground a 12-28% black is invisible. Tier 1 gains the two deep steps the drafts actually draw (--shadow-dark-lg/xl), and --elevation-card/-popover/-modal move into the per-surface blocks so the dark surface can take them while the light one keeps the soft ramp. A resting card now has no shadow at all - the drafts separate with a hairline - and the black is spent on what floats. CARDS. The hover was a white-24% hairline and a faint glow; the drafts turn the hairline accent green, lift the card 6px and land a deep black under it. The lift is pointer-only and is dropped under prefers-reduced-motion. GHOST IS A TEXT LINK. The drafts never fill a ghost control - every "All updates ->" is plain text that turns green while the label-to-arrow gap opens. The tokens carry no fill in any state and the variant opts out of the 3px lift, which also retires the WCAG workaround the old Figma hover forced (green label on a green fill, 1.40:1). NAVIGATION. A nav label rests in text/secondary and brightens to primary; the current section stays primary and is marked by the accent rule, not by green text. HERO STRIPE. The middle block was painted near-black against a comment claiming the redesign had dropped white; the drafts paint it #F8F9FA. Back to background/inverse, and to the drafts' 390 : 495 : 363 split. styles/README.md is updated to match, including a contrast table that still described --surface-raised as the retired #2e2e2c. Not changed, because each is a decision rather than a defect: the drafts set every eyebrow, tag and meta line in IBM Plex Mono at 10-11px with 1.2-1.4px tracking (a third typeface, and no Arabic counterpart); draft headings are weight 800, which needs a font file we do not have; and the EU badge statement stays at --text-primary, since the visibility lockup is contractual. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -60,7 +60,8 @@ A Tailwind 4 `@theme static` block. Raw ramps only, named by value:
|
||||
`--font-weight-regular..black`
|
||||
* space `--spacing-2xs..5xl` - radius `--radius-none..full` -
|
||||
border width `--border-width-sm..xl` - opacity `--opacity-0..100`
|
||||
* shadow `--shadow-xs..xl` - duration `--duration-instant..slower` -
|
||||
* shadow `--shadow-xs..xl` plus the dark-ground steps `--shadow-dark-lg|xl` -
|
||||
duration `--duration-instant..slower` -
|
||||
easing `--ease-standard | decelerate | accelerate | emphasized`
|
||||
* z ladder `--z-0..70` - containers `--container-prose | content | wide`
|
||||
|
||||
@@ -90,6 +91,25 @@ Plain CSS custom properties whose value is always `var(--<primitive>)`. Families
|
||||
`--focus-ring-*` `--overlay-*` `--radius-*` `--control-*` `--layout-*`
|
||||
`--elevation-*` `--motion-*` `--layer-*` `--type-body-base-*`
|
||||
|
||||
Two families are worth knowing by heart, because both were retuned to the
|
||||
Claude Design drafts rather than to the older Figma Button frame:
|
||||
|
||||
* **Shape.** The drafts draw three corners, not five. `--radius-chip` (2px) for
|
||||
a tag, thumbnail, flag or checkbox; `--radius-control` / `--radius-card` /
|
||||
`--radius-surface` (all 4px) for a button, field, menu, card or panel;
|
||||
`--radius-pill` for a filter chip or status pill. Nothing in the drafts is
|
||||
8px or 12px, which is why the old `--radius-control-lg` is gone. The tier-1
|
||||
ramp still carries `--radius-md` / `--radius-lg` - only the meanings moved.
|
||||
* **Elevation.** A shadow is a fraction of the ground it falls on, so
|
||||
`--elevation-card`, `--elevation-popover` and `--elevation-modal` are
|
||||
declared **per surface**. On the dark surface a resting card has no shadow at
|
||||
all (the drafts separate with a hairline) and the deep black - tier 1's
|
||||
`--shadow-dark-lg` / `--shadow-dark-xl`, the drafts' own
|
||||
`0 20px 44px rgba(0,0,0,.5)` and `0 24px 48px rgba(0,0,0,.6)` - is spent on
|
||||
what actually floats: a card under the pointer, the nav dropdown. The light
|
||||
surface keeps the soft ramp. Only `--elevation-flat` and `--elevation-raised`
|
||||
are surface-independent.
|
||||
|
||||
Interactive tokens are fully regular - for each of the five Figma button
|
||||
variants (`primary`, `secondary`, `dark`, `danger`, `ghost`) there is
|
||||
|
||||
@@ -163,12 +183,14 @@ Filenames are case-sensitive in production - match the table exactly.
|
||||
|
||||
## Known deviation from Figma
|
||||
|
||||
The published Ghost button hover paints `background/accent` (`#008764`) and keeps
|
||||
`base/turquoise-dark` (`#006b4f`) as the label - 1.40:1, which fails WCAG AA.
|
||||
`--interactive-ghost-fg-hover` is therefore `--color-white` on **both** surfaces
|
||||
(4.52:1, passes AA for body text). The two lines are marked `(a11y)` in
|
||||
`semantic.css`; revert them to `var(--color-green-700)` for pixel-exact parity
|
||||
if the designer prefers the failure.
|
||||
**Ghost is a text link, not a button.** The published Figma Ghost cell fills on
|
||||
hover (`background/accent` behind a `base/turquoise-dark` label - 1.40:1, a
|
||||
WCAG AA failure). The Claude Design drafts never fill a ghost control: every
|
||||
"All updates ->" / "What we do ->" is plain text in `--text-primary` that turns
|
||||
accent green under the pointer while the label-to-arrow gap opens from 8px to
|
||||
12px. The drafts win, so the ghost tokens carry no fill in any state, the
|
||||
variant opts out of the 3px lift in `Button.css`, and the old a11y workaround
|
||||
is no longer needed.
|
||||
|
||||
## Contrast audit
|
||||
|
||||
@@ -179,25 +201,26 @@ bold) and for non-text UI boundaries (1.4.11).
|
||||
|
||||
### Dark surface (`:root`, `[data-surface="dark"]`)
|
||||
|
||||
| text token | page `#1d1d1b` | raised `#2e2e2c` | sunken `#0b0b0a` | muted (white 8%) | accent-subtle (green 24%) | danger-subtle (red 24%) |
|
||||
| text token | page `#1d1d1b` | raised `#141413` | sunken `#0b0b0a` | muted (white 8%) | accent-subtle (green 24%) | danger-subtle (red 24%) |
|
||||
| --- | --- | --- | --- | --- | --- | --- |
|
||||
| `--text-primary` neutral-50 | 16.02 | 12.91 | 18.68 | 12.71 | 12.40 | 12.86 |
|
||||
| `--text-secondary` neutral-300 | 9.46 | 7.63 | 11.04 | 7.51 | 7.32 | 7.60 |
|
||||
| `--text-tertiary` neutral-400 | 5.56 | 4.48 | 6.48 | 4.41 | 4.30 | 4.46 |
|
||||
| `--text-accent` / `--text-link` green-400 | 6.02 | 4.85 | 7.02 | 4.78 | 4.66 | 4.83 |
|
||||
| `--text-link-hover` green-300 | 8.56 | 6.90 | 9.99 | 6.80 | 6.63 | 6.87 |
|
||||
| `--text-danger` red-400 | 5.39 | 4.34 | 6.29 | 4.28 | 4.17 | 4.33 |
|
||||
| `--text-disabled` neutral-500 | 2.36 | 1.91 | 2.76 | 1.88 | 1.83 | 1.90 |
|
||||
| `--text-primary` neutral-50 | 16.02 | 17.49 | 18.68 | 12.71 | 12.40 | 12.86 |
|
||||
| `--text-secondary` neutral-300 | 9.46 | 10.33 | 11.04 | 7.51 | 7.32 | 7.60 |
|
||||
| `--text-tertiary` neutral-400 | 5.56 | 6.07 | 6.48 | 4.41 | 4.30 | 4.46 |
|
||||
| `--text-accent` / `--text-link` green-400 | 6.02 | 6.57 | 7.02 | 4.78 | 4.66 | 4.83 |
|
||||
| `--text-link-hover` green-300 | 8.56 | 9.35 | 9.99 | 6.80 | 6.63 | 6.87 |
|
||||
| `--text-danger` red-400 | 5.39 | 5.89 | 6.29 | 4.28 | 4.17 | 4.33 |
|
||||
| `--text-disabled` neutral-500 | 2.36 | 2.58 | 2.76 | 1.88 | 1.83 | 1.90 |
|
||||
|
||||
`--text-primary`, `--text-secondary` and `--text-link-hover` pass AA everywhere.
|
||||
Everything below them is only cleared against `--surface-page` and
|
||||
`--surface-sunken`, which is where the design actually uses them:
|
||||
|
||||
* `--surface-raised` is the drafts' `#141413`, DARKER than the page, so every
|
||||
role gains contrast on it rather than losing it - the whole column clears AA.
|
||||
* `--text-tertiary`, `--text-accent`, `--text-link` and `--text-danger` land
|
||||
between 4.17 and 4.85 on `--surface-raised` and on the three translucent
|
||||
fills - AA for large text, **not** for body text. Card bodies use
|
||||
`--text-secondary`; keep tertiary/accent/danger body copy on the page or
|
||||
sunken surface, or raise the text a step.
|
||||
between 4.17 and 4.78 on the three translucent fills - AA for large text,
|
||||
**not** for body text. Card bodies use `--text-secondary`; keep
|
||||
tertiary/accent/danger body copy on an opaque surface, or raise it a step.
|
||||
* `--text-disabled` is 2.36:1 by design. WCAG 1.4.3 exempts the label of a
|
||||
disabled control, so this is deliberate and must not be repointed - it is
|
||||
the only token allowed below 3:1.
|
||||
@@ -250,16 +273,18 @@ Everything below them is only cleared against `--surface-page` and
|
||||
| dark white / `bg-hover` black | 21.00 |
|
||||
| dark `fg-disabled` neutral-300 / `bg-disabled` neutral-600 (dark surface) | 5.39 |
|
||||
| dark `fg-disabled` neutral-200 / `bg-disabled` neutral-500 (light surface) | 4.91 |
|
||||
| **ghost `fg-hover` white / `bg-hover` green-600** (was green-900, 2.62) | **4.52** |
|
||||
| ghost white / `bg-active` green-700 | 6.53 |
|
||||
| ghost `fg` green-400 / dark page | 6.02 |
|
||||
| ghost `fg` green-600 / light page | 4.52 |
|
||||
| ghost `fg` neutral-50 / dark page (no fill in any state) | 16.02 |
|
||||
| ghost `fg-hover` green-400 / dark page | 6.02 |
|
||||
| ghost `fg` neutral-800 / light page | 16.88 |
|
||||
| ghost `fg-hover` green-700 / light page | 6.53 |
|
||||
| **ghost `fg-disabled` neutral-500 / dark page** | **2.36** |
|
||||
| **ghost `fg-disabled` neutral-400 / light page** | **3.04** |
|
||||
| secondary `fg` neutral-50 / dark page | 16.02 |
|
||||
| secondary `fg` neutral-800 / light page | 16.88 |
|
||||
| **secondary `fg-disabled` neutral-500 / dark page** | **2.36** |
|
||||
| **secondary `fg-disabled` neutral-400 / light page** | **3.04** |
|
||||
|
||||
The four bolded disabled rows are the WCAG 1.4.3 exemption again - a disabled
|
||||
The bolded disabled rows are the WCAG 1.4.3 exemption again - a disabled
|
||||
control has no contrast minimum. Every enabled pair clears 4.5:1.
|
||||
|
||||
### Fields and boundaries
|
||||
|
||||
Reference in New Issue
Block a user