Components
Text roles
The kicker, label, section title, standfirst, lead, code, prose, list and the two reading inks, one class each.
Usage
Section header
Section kicker
The section title
A standfirst that says what this section argues, in one sentence.
Uses.aka-kicker.aka-label.aka-section-title.aka-standfirst.aka-lead.aka-code.aka-prose.aka-list.aka-ink-body.aka-ink-quiet
<p className="aka-kicker">Section kicker</p> <h2 className="mt-2 aka-section-title">The section title</h2> <p className="aka-standfirst">A standfirst that says what this section argues, in one sentence.</p>
The page rhythm: kicker, title, standfirst, stacked. mt-2 is the step under a kicker. These used to be utility strings copied across the site, and for a while the strings lied: the theme colours had no alpha slot, so the /70 on the kicker and the /90 on the title never compiled and every call site inherited its ink. The classes carry the ink the roles were always meant to, so a change to a role is a change to its lines in globals.css and not to a hundred call sites.
Examples
Label
Card label
<p className="aka-label">Card label</p>
A kicker at a card's scale: the label inside a card head or above a table.
Lead
Why keep this page
<h3 className="aka-lead">Why keep this page</h3>
The heading that opens a block inside a write-up.
Prose and list
Body copy is sans and light, and the space between paragraphs is generous enough that each one reads as its own thought rather than the next line of the last.
- Watch the work first.
- Prototype in code.
- Ship the smallest true thing.
<div className="aka-prose">
<p>Body copy is sans and light.</p>
<ul className="aka-list space-y-2">
<li>Watch the work first.</li>
<li>Prototype in code.</li>
</ul>
</div>15px light on the muted ink, 1.6 leading, paragraphs 2.5rem apart, so each one reads as its own thought. The list's markers are the muted ink at the floor; its spacing stays a utility. Full ink is for the terms a reader will look for again.
Code
Run npm test before a push.
npm run style:check
<p>Run <code className="aka-code">npm test</code> before a push.</p> <pre className="aka-card-well overflow-x-auto rounded-lg p-4 font-mono text-11 leading-relaxed text-foreground/80"> npm run style:check </pre>
The inline chip names its own ink, because its tinted ground is not the page the floor is measured on. A block is a string, in the well.
Reading ink
Body ink. What an essay is set in.
Quiet ink. A caption, a date, an aside.
<p className="aka-ink-body">Body ink. What an essay is set in.</p> <p className="aka-ink-quiet">Quiet ink. A caption, a date, an aside.</p>
Classes, not utilities: an essay names its ink once instead of carrying a number through every paragraph. The two steps and their reasoning are on Colors.
Quiet list
- Watch the work first. research before design
- Prototype in code. working surfaces over mockups
<li className="flex gap-3"> <span aria-hidden className="mt-[7px] h-1 w-1 shrink-0 rounded-full bg-muted-foreground/40" /> <span><span className="text-foreground/85">Term.</span> Then the body.</span> </li>
A string: dot markers quieter than the disc, for a short list inside prose. aka-list is for reference lists.
Best practices
When to use
- Every heading, label and paragraph on a page takes one of these roles rather than a size and an ink of its own.
- A role that needs a variant gets a new class and a specimen in the same push.
- Never paste the utility string a role used to be.
Behaviour
- Each role is exactly the CSS the utilities it replaced emitted, so nothing moved when they landed.
- Sizes come from the type scale only. Inks sit at or above the floor.
Accessibility
- A role is a look, not a level: choose h1, h2 or h3 for the outline, then the class for the look.
- Quiet inks are measured against the page. On a tinted ground name a stronger ink, as aka-code does.
CSS
The rules, as globals.css has them, with the reasoning the stylesheet keeps beside them.
@layer components {
/*
* The text roles, named.
*
* Each of these was a class string copied across the site (the lead 127
* times, the code chip 84, the kicker 16 under four different names) and
* each had drifted into variants. They are one definition now, and each is
* written as exactly the CSS the utilities it replaces emitted, so nothing
* on the page moved when they landed.
*
* Some of those strings carried a colour modifier that, for a long time,
* emitted nothing: the theme colours were bare var() with no alpha slot, so
* `text-foreground/90` was dropped by Tailwind and the element inherited.
* The slot exists now (tailwind.config.cjs), and these roles carry the ink
* they were always meant to, mixed the same way the utilities mix theirs.
*/
.aka-kicker {
font-size: 11px;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.18em;
color: color-mix(in srgb, var(--muted-foreground) 75%, transparent);
}
/* The label inside a card head or above a table: a kicker's job at a card's scale. */
.aka-label {
font-size: 10px;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.14em;
color: color-mix(in srgb, var(--muted-foreground) 75%, transparent);
}
.aka-section-title {
font-size: 1.25rem;
line-height: 1.75rem;
font-weight: 300;
letter-spacing: -0.025em;
color: color-mix(in srgb, var(--foreground) 90%, transparent);
}
.aka-standfirst {
margin-top: 0.5rem;
max-width: 36rem;
font-size: 13px;
font-weight: 300;
line-height: 1.625;
color: var(--muted-foreground);
}
.aka-lead {
font-size: 0.875rem;
line-height: 1.25rem;
font-weight: 500;
letter-spacing: 0.025em;
color: var(--foreground);
}
.aka-code {
/*
* The chip names its ink rather than inheriting one. Its ground is a
* tint, lighter than the page in dark and darker in light, and a quiet
* ink that clears the page at the floor (law 09) does not clear the tint.
* The muted ink at full strength clears both.
*/
color: var(--muted-foreground);
background-color: color-mix(in srgb, var(--muted) 60%, transparent);
border-radius: var(--radius-xs);
padding: 0.125rem 0.25rem;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
font-size: 12px;
}
}
@layer components {
.aka-prose {
font-size: 15px;
font-weight: 300;
line-height: 1.625;
color: var(--muted-foreground);
}
.aka-prose > :not([hidden]) ~ :not([hidden]) {
margin-top: 2.5rem;
}
.aka-list {
list-style-type: disc;
padding-left: 1.25rem;
}
.aka-list > li::marker {
color: color-mix(in srgb, var(--muted-foreground) 75%, transparent);
}
}