open-design/design-systems/perplexity/components.html
chaoxiaoche 788ce450fc
feat(design-systems): add tokens.css + components.html for 10 AI / devtool brands (#2023)
Brands added (each with full 56-token :root + self-contained fixture):
- Tier A (AI ecosystem): x-ai, perplexity, ollama, runwayml, minimax
- Tier B (AI-adjacent devtools): supabase, posthog, resend, shadcn, raycast

All 10 declare the complete shared schema (26 A1 + 26 A2 + 4 B-slot) with no
C-extensions; pnpm guard reports 27 brand pairs aligned end-to-end.

Co-authored-by: chaoxiaoche <chaoxiaoche@chaoxiaochedeMacBook-Pro.local>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 14:03:36 +08:00

455 lines
16 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Perplexity — reference components</title>
<meta
name="description"
content="Reference fixture for design-systems/perplexity. Every visible
value comes from tokens.css. Perplexity's signature moves: flat
near-black canvas, Inter for UI, JetBrains Mono for citations,
purple accent used once per view, hairline borders instead of
drop shadows, answer-first single-column layout."
/>
<style>
:root {
--bg: #0f0f10;
--surface: #19191a;
--surface-warm: var(--surface);
--fg: #f0f0f0;
--fg-2: var(--fg);
--muted: #9b9b9b;
--meta: #5c5c5e;
--border: #2e2e30;
--border-soft: #232325;
--accent: #a855f7;
--accent-on: #ffffff;
--accent-hover: #c084fc;
--accent-active: #9333ea;
--success: #22c55e;
--warn: #f59e0b;
--danger: #ef4444;
--font-display: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, Monaco, Consolas, monospace;
--text-xs: 11px;
--text-sm: 13px;
--text-base: 15px;
--text-lg: 16px;
--text-xl: 18px;
--text-2xl: 22px;
--text-3xl: 28px;
--text-4xl: 32px;
--leading-body: 1.65;
--leading-tight: 1.2;
--tracking-display: -0.01em;
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-5: 20px;
--space-6: 24px;
--space-8: 32px;
--space-12: 48px;
--section-y-desktop: 64px;
--section-y-tablet: 48px;
--section-y-phone: 32px;
--radius-sm: 4px;
--radius-md: 8px;
--radius-lg: 12px;
--radius-pill: 9999px;
--elev-flat: none;
--elev-ring: 0 0 0 1px var(--border);
--elev-raised: 0 0 0 1px var(--border);
--focus-ring: 0 0 0 2px var(--accent);
--motion-fast: 120ms;
--motion-base: 200ms;
--ease-standard: cubic-bezier(0.2, 0, 0, 1);
--container-max: 1100px;
--container-gutter-desktop: 24px;
--container-gutter-tablet: 16px;
--container-gutter-phone: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
background: var(--bg);
color: var(--fg);
font-family: var(--font-body);
font-size: var(--text-base);
line-height: var(--leading-body);
-webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { transition: none !important; animation: none !important; }
}
.container {
max-width: var(--container-max);
margin-inline: auto;
padding-inline: var(--container-gutter-desktop);
}
section { padding-block: var(--section-y-desktop); }
section + section { border-top: 1px solid var(--border); }
@media (max-width: 1023px) {
.container { padding-inline: var(--container-gutter-tablet); }
section { padding-block: var(--section-y-tablet); }
}
@media (max-width: 639px) {
.container { padding-inline: var(--container-gutter-phone); }
section { padding-block: var(--section-y-phone); }
}
/* ─── Typography ─────────────────────────── */
h1, h2, h3 {
font-family: var(--font-display);
margin: 0;
color: var(--fg);
font-weight: 600;
line-height: var(--leading-tight);
}
h1 {
font-size: var(--text-4xl);
letter-spacing: var(--tracking-display);
}
h2 {
font-size: var(--text-2xl);
line-height: 1.3;
}
h3 {
font-size: var(--text-xl);
line-height: 1.4;
}
p { margin: 0; }
.lead {
font-size: var(--text-lg);
line-height: 1.6;
color: var(--muted);
font-weight: 400;
max-width: 60ch;
}
.body-muted { color: var(--muted); }
.body-sm { font-size: var(--text-sm); color: var(--muted); }
.eyebrow {
font-family: var(--font-mono);
font-size: var(--text-xs);
font-weight: 400;
color: var(--muted);
letter-spacing: 0.04em;
}
code, .mono {
font-family: var(--font-mono);
font-size: 0.92em;
color: var(--fg);
}
.stack-3 > * + * { margin-block-start: var(--space-3); }
.stack-4 > * + * { margin-block-start: var(--space-4); }
.stack-5 > * + * { margin-block-start: var(--space-5); }
.stack-6 > * + * { margin-block-start: var(--space-6); }
/* ─── Buttons ─────────────────────────────── */
.btn {
display: inline-flex;
align-items: center;
gap: var(--space-2);
padding: 10px 20px;
border-radius: var(--radius-md);
font-family: var(--font-body);
font-size: var(--text-base);
font-weight: 500;
line-height: 1;
cursor: pointer;
border: 1px solid transparent;
transition: background-color var(--motion-fast) var(--ease-standard),
border-color var(--motion-fast) var(--ease-standard);
text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary {
background: var(--accent);
color: var(--accent-on);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-active); }
.btn-ghost {
background: transparent;
color: var(--fg);
border-color: var(--border);
}
.btn-ghost:hover { background: var(--border-soft); }
/* ─── Source badge — DESIGN.md §6 ─────────── */
.source-badge {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: 3px 8px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
font-family: var(--font-mono);
font-size: var(--text-xs);
color: var(--muted);
text-decoration: none;
}
.source-badge::before {
content: "";
width: 6px;
height: 6px;
border-radius: var(--radius-pill);
background: var(--accent);
opacity: 0.55;
flex-shrink: 0;
}
/* ─── Tab bar — DESIGN.md §6 ────────────── */
.tabbar {
display: flex;
gap: var(--space-5);
border-bottom: 1px solid var(--border);
padding-block-end: var(--space-3);
margin-block-end: var(--space-5);
}
.tab {
font-size: var(--text-sm);
color: var(--muted);
padding-block-end: var(--space-2);
border-bottom: 2px solid transparent;
margin-bottom: -1px;
cursor: pointer;
font-weight: 500;
}
.tab[aria-current="page"] {
color: var(--fg);
border-bottom-color: var(--accent);
}
/* ─── Cards (answer + source) ───────────── */
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: var(--space-5);
box-shadow: var(--elev-flat);
transition: background-color var(--motion-fast) var(--ease-standard);
}
.card:hover { background: var(--border-soft); }
/* ─── Search field — DESIGN.md §5 ────────── */
.search {
display: flex;
align-items: center;
gap: var(--space-3);
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 12px 16px;
transition: border-color var(--motion-fast) var(--ease-standard);
}
.search:focus-within { border-color: var(--accent); }
.search input {
flex: 1;
background: transparent;
border: none;
outline: none;
color: var(--fg);
font-family: var(--font-body);
font-size: var(--text-base);
line-height: 1.4;
}
.search input::placeholder { color: var(--meta); }
.search-submit {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
background: transparent;
border: none;
border-radius: var(--radius-sm);
color: var(--muted);
cursor: pointer;
transition: color var(--motion-fast) var(--ease-standard);
}
.search:focus-within .search-submit { color: var(--accent); }
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field label {
font-size: var(--text-sm);
font-weight: 500;
color: var(--fg);
}
.field input {
background: var(--surface);
color: var(--fg);
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 10px 14px;
font-family: var(--font-body);
font-size: var(--text-base);
outline: none;
transition: border-color var(--motion-fast) var(--ease-standard);
}
.field input::placeholder { color: var(--meta); }
.field input:focus { border-color: var(--accent); }
/* ─── Layout ─────────────────────────────── */
.hero-grid {
display: grid;
grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
gap: var(--space-12);
align-items: start;
}
@media (max-width: 1023px) { .hero-grid { grid-template-columns: 1fr; } }
.features-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--space-4);
}
@media (max-width: 1023px) { .features-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 639px) { .features-grid { grid-template-columns: 1fr; } }
.hero-actions { display: flex; gap: var(--space-3); margin-block-start: var(--space-5); flex-wrap: wrap; }
.source-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.icon { width: 16px; height: 16px; flex-shrink: 0; }
</style>
</head>
<body>
<main class="container">
<!-- HERO — answers, not links. DESIGN.md §5 answer-first pattern. -->
<section data-od-id="hero">
<div class="hero-grid">
<div class="stack-5">
<p class="eyebrow">perplexity / reference fixture</p>
<h1>Answers, not links.</h1>
<p class="lead">
Ask anything. Perplexity reads the sources, cites the
passage, and returns a single, grounded answer — no
ten-blue-links detour, no auto-play, no autoplaying anything.
</p>
<div class="search" role="search" aria-label="Ask Perplexity">
<span aria-hidden="true" style="color:var(--muted);display:inline-flex">
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" aria-hidden="true">
<circle cx="11" cy="11" r="7"/>
<path d="M20 20l-3.5-3.5"/>
</svg>
</span>
<input type="text" placeholder="Ask anything." aria-label="Ask Perplexity" />
<button type="button" class="search-submit" aria-label="Submit query">
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" aria-hidden="true">
<path d="M5 12h14M13 6l6 6-6 6"/>
</svg>
</button>
</div>
<div class="hero-actions">
<a href="./tokens.css" class="btn btn-primary">Search</a>
<a href="./DESIGN.md" class="btn btn-ghost">Read the spec</a>
</div>
</div>
<aside class="card">
<div class="tabbar" role="tablist">
<span class="tab" aria-current="page" role="tab">Answer</span>
<span class="tab" role="tab">Sources</span>
<span class="tab" role="tab">Steps</span>
</div>
<p class="eyebrow" style="margin-bottom:var(--space-3)">Q · who first measured the speed of light?</p>
<p style="color:var(--fg)">
Ole Rømer, in 1676, by timing eclipses of Jupiter's moon Io as
Earth moved toward and away from Jupiter — a delay of
<code>~22 min</code> across the orbit yielded the first
finite estimate.
</p>
<div class="source-row" style="margin-block-start:var(--space-4)">
<a class="source-badge" href="#"><span class="mono">nature.com</span></a>
<a class="source-badge" href="#"><span class="mono">en.wikipedia.org</span></a>
<a class="source-badge" href="#"><span class="mono">aps.org</span></a>
<a class="source-badge" href="#"><span class="mono">arxiv.org</span></a>
</div>
</aside>
</div>
</section>
<!-- FEATURES — three quiet propositions, no decorative imagery. -->
<section data-od-id="features">
<div class="stack-3" style="margin-bottom:var(--space-6)">
<p class="eyebrow">what this fixture exercises</p>
<h2>Quiet by design.</h2>
</div>
<div class="features-grid">
<article class="card stack-3">
<h3>Cited</h3>
<p class="body-sm">
Every factual claim is attributed. Source badges sit
beneath the answer in <code>JetBrains Mono</code>, sentence
case, never decorative.
</p>
</article>
<article class="card stack-3">
<h3>Grounded</h3>
<p class="body-sm">
Flat <code>#0f0f10</code> canvas with three luminance
steps. No gradient hero, no animated blob — the chrome
recedes, the answer leads.
</p>
</article>
<article class="card stack-3">
<h3>Restrained</h3>
<p class="body-sm">
Purple <code>#a855f7</code> appears once per view: the
primary action. Borders before shadows, content before
motion.
</p>
</article>
</div>
</section>
<!-- FORM — direct copy, no apology. DESIGN.md §8 voice. -->
<section data-od-id="form">
<div style="display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:var(--space-12);align-items:start">
<div class="stack-4">
<p class="eyebrow">form components</p>
<h2>Keep the signal in.</h2>
<p class="lead">
Sign in to keep your threads, follow-ups, and saved sources
across devices. No newsletter trickery, no marketing checkbox
defaulted on.
</p>
</div>
<form style="display:flex;flex-direction:column;gap:var(--space-4);max-width:420px"
onsubmit="event.preventDefault()">
<div class="field">
<label for="email">Email</label>
<input id="email" type="email" placeholder="you@domain.com" />
</div>
<div style="display:flex;gap:var(--space-3);margin-top:var(--space-2)">
<button type="submit" class="btn btn-primary">Continue</button>
<button type="button" class="btn btn-ghost">Use a passkey</button>
</div>
</form>
</div>
</section>
</main>
</body>
</html>