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:
2026-09-20 11:14:15 +02:00
co-authored by Claude Opus 5
parent aedef6daeb
commit 19fab4a783
19 changed files with 197 additions and 99 deletions
+25 -5
View File
@@ -26,6 +26,9 @@
* "Ghost / Large / Default" is the one cell in the matrix with no padding
while its own Hover and Disabled cells have it - an authoring slip that
would make the button jump on hover. Padding is kept on all ghost states.
* Ghost is repainted to the Claude Design drafts rather than to the Figma
frame: text-only throughout, no hover fill, no lift, widening gap. See
the block below and the ghost tokens in semantic.css.
* Disabled uses the opaque `-bg-disabled` / `-fg-disabled` tokens rather than
Figma's 40% opacity, so the page never shows through a disabled control.
`--control-opacity-disabled` still holds the 0.4 if that is ever wanted.
@@ -190,11 +193,28 @@
--sh-btn-border-disabled: var(--interactive-ghost-border-disabled);
}
/* Figma gives the ghost md/lg cells radius.md while every other cell uses
radius.sm - reproduced rather than normalised. */
.sh-btn[data-variant="ghost"][data-size="md"],
.sh-btn[data-variant="ghost"][data-size="lg"] {
border-radius: var(--radius-control-lg);
/* GHOST IS A TEXT LINK, NOT A BUTTON.
The drafts draw "All updates ->" and "What we do ->" as plain text that
turns accent green while the label-to-arrow gap opens from 8px to 12px.
So the ghost variant opts out of the 3px lift the filled controls take -
nothing that has no box should appear to rise off the page - and animates
its gap instead. (The old Figma-quirk override that gave ghost md/lg
radius.md is gone with --radius-control-lg; every control is 4px.) */
.sh-btn[data-variant="ghost"] .sh-btn__content {
transition:
opacity var(--motion-duration-fast) var(--motion-ease-standard),
gap var(--motion-duration-base) var(--motion-ease-standard);
}
@media (hover: hover) {
.sh-btn[data-variant="ghost"]:hover:not(:disabled):not([aria-disabled="true"]):not([data-loading]) {
transform: none;
}
.sh-btn[data-variant="ghost"]:hover:not(:disabled):not([aria-disabled="true"]):not([data-loading])
.sh-btn__content {
gap: var(--spacing-sm);
}
}
/* ---------------------------------------------------------------------
+4 -1
View File
@@ -65,7 +65,10 @@ export function CardCTA({
data-surface="dark"
className={cx(
"sh-card relative flex flex-col gap-lg rounded-surface p-10",
"bg-surface-accent text-text-on-accent shadow-[var(--elevation-popover)]",
/* The drafts rest nothing on a shadow - a panel is a fill and an edge,
and the black is spent on what floats. --elevation-card is that
resting step: none on the dark surface, soft on the light one. */
"bg-surface-accent text-text-on-accent shadow-[var(--elevation-card)]",
"sm:flex-row sm:items-center",
className,
)}
@@ -85,7 +85,7 @@ export function CardContent({
light on both surfaces - text-on-accent is the only always-white
role, text-primary would go dark on the light surface. */}
{badge ? (
<span className="absolute start-md top-md rounded-control-lg bg-overlay-scrim px-xs py-2xs label-md text-text-on-accent backdrop-blur-[4px]">
<span className="absolute start-md top-md rounded-chip bg-overlay-scrim px-xs py-2xs label-md text-text-on-accent backdrop-blur-[4px]">
{badge}
</span>
) : null}
@@ -7,7 +7,7 @@
STYLING RULE for this whole directory:
* colour and radius come from the tier-2 Tailwind bridge
(bg-surface-raised, text-text-accent, border-border-subtle,
rounded-surface, ...) - never a hex, never a tier-1 primitive;
rounded-card, ...) - never a hex, never a tier-1 primitive;
* tokens without a bridge utility are spent as arbitrary values,
e.g. shadow-[var(--elevation-card)];
* spacing uses the named scale (p-lg = 24, gap-md = 16) so the Figma
@@ -143,8 +143,10 @@ export interface CardShellProps {
}
/**
* The surface every card shares: raised fill, hairline border, 12px corner
* (Figma radius/lg) and the card elevation.
* The surface every card shares: raised fill, hairline border and the 4px
* corner the design drafts draw. `--elevation-card` is the drafts' resting
* shadow, which on the dark surface is none at all - the hairline does the
* separating, and the black is kept for the hover state in card.css.
*/
export function CardShell({
as = "article",
@@ -160,7 +162,7 @@ export function CardShell({
"sh-card",
linked && "sh-card--linked",
"relative flex bg-[var(--surface-card)] text-text-primary",
"rounded-surface border border-border-subtle shadow-[var(--elevation-card)]",
"rounded-card border border-border-subtle shadow-[var(--elevation-card)]",
className,
)}
>
+1 -1
View File
@@ -72,7 +72,7 @@ export function CardStat({
is falling. */
<span
className={cx(
"inline-flex shrink-0 items-center gap-2xs rounded-control-lg px-xs py-2xs",
"inline-flex shrink-0 items-center gap-2xs rounded-chip px-xs py-2xs",
"label-md text-text-on-accent",
isDown ? "bg-surface-danger" : "bg-surface-accent",
)}
+17 -4
View File
@@ -2,7 +2,7 @@
CARD - mechanics that cannot be expressed as a utility
----------------------------------------------------------------------------
Everything token-driven lives in the TSX as a tier-2 utility
(bg-surface-raised, text-text-accent, rounded-surface, ...). This file only
(bg-surface-raised, text-text-accent, rounded-card, ...). This file only
holds the three things a utility cannot do:
1. paint an exported SVG asset in the current token colour (mask),
@@ -13,7 +13,7 @@
component rather than by app/app.css, so it is not scoped by anything else.
Everything lives in @layer components so a Tailwind utility passed through
`className` (`rounded-surface`, `text-text-secondary`, ...) still wins.
`className` (`rounded-card`, `text-text-secondary`, ...) still wins.
The layer statement is a defensive no-op when app.css has already declared
the same order, and makes this file correct on its own if it ever loads first.
========================================================================= */
@@ -88,17 +88,29 @@
/* ---------------------------------------------------------------------------
HOVER / FOCUS AFFORDANCES
------------------------------------------------------------------------ */
/* The drafts hover a card three ways at once: the hairline turns accent
green, the card rises, and a deep black lands under it. The lift is
pointer-only - a touch "hover" would leave the card raised after the tap -
and it is dropped entirely under prefers-reduced-motion below, because a
transform still lands instantly once app.css has flattened the duration. */
.sh-card--linked {
transition:
box-shadow var(--motion-duration-base) var(--motion-ease-standard),
border-color var(--motion-duration-base) var(--motion-ease-standard);
border-color var(--motion-duration-base) var(--motion-ease-standard),
transform var(--motion-duration-base) var(--motion-ease-standard);
}
.sh-card--linked:hover {
border-color: var(--border-default);
border-color: var(--border-accent);
box-shadow: var(--elevation-popover);
}
@media (hover: hover) {
.sh-card--linked:hover {
transform: translateY(-6px);
}
}
.sh-card--linked:hover .sh-card-title,
.sh-card--linked:has(.sh-card-link:focus-visible) .sh-card-title {
text-decoration: underline;
@@ -116,6 +128,7 @@
/* app.css already neutralises transition durations under reduced motion, but a
transform still lands instantly - drop it entirely. */
@media (prefers-reduced-motion: reduce) {
.sh-card--linked:hover,
.sh-card--linked:hover .sh-card-media img {
transform: none;
}
+1 -1
View File
@@ -82,7 +82,7 @@
background-color: var(--field-bg);
color: var(--field-fg);
border: var(--control-border-width) solid var(--field-border);
border-radius: var(--radius-control-lg);
border-radius: var(--radius-control);
padding-inline: calc(var(--control-padding-inline-md) - var(--control-border-width));
padding-block: calc(var(--control-padding-block-md) - var(--control-border-width));
text-align: start;
@@ -436,10 +436,14 @@ export function DesktopNav({
className={cx(
"body-sm-bold flex cursor-pointer items-center gap-2xs",
"whitespace-nowrap pb-[2px] text-start",
"text-[var(--text-primary)]",
"hover:text-[var(--text-accent)]",
"aria-expanded:text-[var(--text-accent)]",
"data-[current=true]:text-[var(--text-accent)]",
/* The drafts rest a nav label in text/secondary and
brighten it to primary under the pointer; the section
the reader is in stays primary and is marked by the
accent rule below, not by green text. */
"text-[var(--text-secondary)]",
"hover:text-[var(--text-primary)]",
"aria-expanded:text-[var(--text-primary)]",
"data-[current=true]:text-[var(--text-primary)]",
HOVER_TRANSITION,
FOCUS_RING,
)}
@@ -512,9 +516,10 @@ export function DesktopNav({
onFocus={closeGroup}
className={cx(
"body-sm-bold whitespace-nowrap pb-[2px] no-underline",
"text-[var(--text-primary)]",
"hover:text-[var(--text-accent)]",
"aria-[current=page]:text-[var(--text-accent)]",
/* Same rest/hover/current treatment as a group trigger. */
"text-[var(--text-secondary)]",
"hover:text-[var(--text-primary)]",
"aria-[current=page]:text-[var(--text-primary)]",
HOVER_TRANSITION,
FOCUS_RING,
)}