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:
@@ -121,19 +121,18 @@
|
||||
--interactive-danger-border-disabled: var(--color-transparent);
|
||||
|
||||
/* --- interactive: ghost (text-only) -------------------------------------
|
||||
DEVIATION FROM FIGMA (a11y). The published component paints the hover
|
||||
background/accent (#008764) and keeps base/turquoise-dark (#006b4f) as
|
||||
the label - 1.40:1, far below WCAG AA. Both surfaces therefore use white
|
||||
on the accent fill, which is 4.52:1 and passes AA for body text. The two
|
||||
lines marked (a11y) are the only ones that differ from Figma; reverting
|
||||
them to var(--color-green-700) restores pixel parity and the failure. */
|
||||
The drafts never fill a ghost control. Every "All updates ->" / "What we
|
||||
do ->" link is plain text in --text-primary that turns accent green under
|
||||
the pointer while the label-to-arrow gap opens; the fill the old Figma
|
||||
Button frame painted on hover (background/accent behind a green label,
|
||||
1.40:1) is gone, and with it the a11y deviation it forced. */
|
||||
--interactive-ghost-bg: var(--color-transparent);
|
||||
--interactive-ghost-bg-hover: var(--color-green-600);
|
||||
--interactive-ghost-bg-active: var(--color-green-700);
|
||||
--interactive-ghost-bg-hover: var(--color-transparent);
|
||||
--interactive-ghost-bg-active: var(--color-transparent);
|
||||
--interactive-ghost-bg-disabled: var(--color-transparent);
|
||||
--interactive-ghost-fg: var(--color-green-400);
|
||||
--interactive-ghost-fg-hover: var(--color-white); /* (a11y) 4.52:1 on green-600; figma: green-700 = 1.40:1 */
|
||||
--interactive-ghost-fg-disabled: var(--color-green-400);
|
||||
--interactive-ghost-fg: var(--color-neutral-50);
|
||||
--interactive-ghost-fg-hover: var(--color-green-400); /* 6.02:1 on the page ground */
|
||||
--interactive-ghost-fg-disabled: var(--color-neutral-500);
|
||||
--interactive-ghost-border: var(--color-transparent);
|
||||
--interactive-ghost-border-hover: var(--color-transparent);
|
||||
--interactive-ghost-border-disabled: var(--color-transparent);
|
||||
@@ -165,6 +164,14 @@
|
||||
they carry the same value on either surface. */
|
||||
--overlay-picture-shade: var(--color-black-a20);
|
||||
--overlay-picture-tint: var(--color-green-200-a12);
|
||||
|
||||
/* --- elevation ----------------------------------------------------------
|
||||
The drafts give a resting card a hairline and no shadow at all, and keep
|
||||
the black for what genuinely floats: a card under the pointer and the
|
||||
navigation dropdown. */
|
||||
--elevation-card: var(--shadow-none);
|
||||
--elevation-popover: var(--shadow-dark-lg);
|
||||
--elevation-modal: var(--shadow-dark-xl);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------
|
||||
@@ -262,14 +269,14 @@
|
||||
--interactive-danger-border-hover: var(--color-transparent);
|
||||
--interactive-danger-border-disabled: var(--color-transparent);
|
||||
|
||||
/* --- interactive: ghost (text-only) - see the a11y note above ---------- */
|
||||
/* --- interactive: ghost (text-only) - see the note above --------------- */
|
||||
--interactive-ghost-bg: var(--color-transparent);
|
||||
--interactive-ghost-bg-hover: var(--color-green-600);
|
||||
--interactive-ghost-bg-active: var(--color-green-700);
|
||||
--interactive-ghost-bg-hover: var(--color-transparent);
|
||||
--interactive-ghost-bg-active: var(--color-transparent);
|
||||
--interactive-ghost-bg-disabled: var(--color-transparent);
|
||||
--interactive-ghost-fg: var(--color-green-600);
|
||||
--interactive-ghost-fg-hover: var(--color-white); /* (a11y) 4.52:1 on green-600; figma: green-700 = 1.40:1 */
|
||||
--interactive-ghost-fg-disabled: var(--color-green-600);
|
||||
--interactive-ghost-fg: var(--color-neutral-800);
|
||||
--interactive-ghost-fg-hover: var(--color-green-700); /* 6.53:1 on white */
|
||||
--interactive-ghost-fg-disabled: var(--color-neutral-400);
|
||||
--interactive-ghost-border: var(--color-transparent);
|
||||
--interactive-ghost-border-hover: var(--color-transparent);
|
||||
--interactive-ghost-border-disabled: var(--color-transparent);
|
||||
@@ -299,6 +306,11 @@
|
||||
they carry the same value on either surface. */
|
||||
--overlay-picture-shade: var(--color-black-a20);
|
||||
--overlay-picture-tint: var(--color-green-200-a12);
|
||||
|
||||
/* --- elevation - the soft ramp; the deep black belongs on the dark ground */
|
||||
--elevation-card: var(--shadow-md);
|
||||
--elevation-popover: var(--shadow-lg);
|
||||
--elevation-modal: var(--shadow-xl);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------
|
||||
@@ -308,7 +320,7 @@
|
||||
------------------------------------------------------------------------ */
|
||||
:root {
|
||||
/* --- shape -------------------------------------------------------------
|
||||
--radius-control / --radius-control-lg / --radius-card / --radius-surface
|
||||
--radius-chip / --radius-control / --radius-card / --radius-surface
|
||||
/ --radius-pill are declared in the @theme block near the bottom of this
|
||||
file so that they also generate rounded-* utilities. They are tier-2
|
||||
tokens like everything else here. */
|
||||
@@ -348,12 +360,13 @@
|
||||
--layout-content-max: var(--container-content);
|
||||
--layout-prose-max: var(--container-prose);
|
||||
|
||||
/* --- elevation ---------------------------------------------------------- */
|
||||
/* --- elevation ----------------------------------------------------------
|
||||
Only the two flattest steps are surface-independent. A shadow is a
|
||||
fraction of the ground it falls on, so --elevation-card / -popover /
|
||||
-modal are declared inside each surface block above: the dark surface
|
||||
takes the drafts' deep black, the light one keeps the soft ramp. */
|
||||
--elevation-flat: var(--shadow-none);
|
||||
--elevation-raised: var(--shadow-sm);
|
||||
--elevation-card: var(--shadow-md);
|
||||
--elevation-popover: var(--shadow-lg);
|
||||
--elevation-modal: var(--shadow-xl);
|
||||
|
||||
/* --- focus ring geometry ------------------------------------------------- */
|
||||
--focus-ring-width: var(--border-width-lg);
|
||||
@@ -430,7 +443,6 @@
|
||||
--color-interactive-dark-hover: var(--interactive-dark-bg-hover);
|
||||
--color-interactive-danger: var(--interactive-danger-bg);
|
||||
--color-interactive-danger-hover: var(--interactive-danger-bg-hover);
|
||||
--color-interactive-ghost-hover: var(--interactive-ghost-bg-hover);
|
||||
|
||||
--color-field-bg: var(--field-bg);
|
||||
--color-field-border: var(--field-border);
|
||||
@@ -443,13 +455,21 @@
|
||||
}
|
||||
|
||||
/* Shape semantics that also need to exist as Tailwind utilities
|
||||
(rounded-control / rounded-card / rounded-surface). They alias tier 1
|
||||
directly - never a tier-2 name, which would self-reference. */
|
||||
(rounded-chip / rounded-control / rounded-card / rounded-surface). They
|
||||
alias tier 1 directly - never a tier-2 name, which would self-reference.
|
||||
|
||||
THE DRAFTS DRAW THREE CORNERS, NOT FIVE. Every panel, card, button, input
|
||||
and menu in the Claude Design drafts is 4px; every tag, thumbnail, flag and
|
||||
checkbox is 2px; filter chips and the status pill are fully round. Nothing
|
||||
in the drafts is 8px or 12px, so `--radius-card` and `--radius-surface` come
|
||||
down to radius/sm and the old `--radius-control-lg` (radius/md, a quirk of
|
||||
the Figma Button frame's ghost cells) is gone. The tier-1 ramp is untouched:
|
||||
only the meanings moved. */
|
||||
@theme static {
|
||||
--radius-control: var(--radius-sm);
|
||||
--radius-control-lg: var(--radius-md);
|
||||
--radius-card: var(--radius-md);
|
||||
--radius-surface: var(--radius-lg);
|
||||
--radius-chip: var(--radius-xs); /* 2px - tags, thumbnails, checkboxes */
|
||||
--radius-control: var(--radius-sm); /* 4px - buttons, fields, menu items */
|
||||
--radius-card: var(--radius-sm); /* 4px */
|
||||
--radius-surface: var(--radius-sm); /* 4px */
|
||||
--radius-pill: var(--radius-full);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user