Components
Button
The two buttons the site ships: the primary, filled in the ink, and the secondary, on the ground.
Usage
Primary
Uses.aka-button.aka-button-secondary
<a href="/demo" className="aka-button">See the work</a>
This page once documented a larger pair, px-4 py-2.5 at 14px, that appeared nowhere on the site: every call to action is the 13px pair. The pair is two classes now, so the specimen and the pages read one definition and cannot disagree again.
Examples
Secondary
<a href="/aka-style" className="aka-button-secondary">Read the system</a>
<div className="flex flex-wrap gap-3"> <a href="/demo" className="aka-button">See the work</a> <a href="/aka-style" className="aka-button-secondary">Read the system</a> </div>
The closing call to action on a write-up: the action the page exists for, and the way out beside it.
Sizes
sm rounded-md px-3 py-1.5 text-12 md aka-button (rounded-lg px-3.5 py-2 text-13) lg rounded-lg px-5 py-3 text-15
Strings, not classes. aka-button is the md step; sm and lg are for the rare place that needs them, written on the element beside the ink and the edge.
Disabled
<button type="button" disabled className="inline-flex items-center rounded-lg border border-border bg-background px-3.5 py-2 text-13 font-medium text-muted-foreground/75"> Unavailable </button>
A string as well: the classes carry no disabled state. The ink drops to the floor, never under it.
Best practices
When to use
- One primary per view: the action the page exists to offer.
- The secondary for the alternative beside it, or any action that is not the point of the page.
- A link rather than a button for navigation inside running text: aka-ink-link or aka-quiet-link.
Behaviour
- The primary lifts 1px on hover and the secondary takes a fill. Neither dims, per law 04.
- Hover rules sit under (hover: hover), so a tapped button does not latch in its hover state.
- Under reduced motion the primary does not lift.
Accessibility
- Use <a> to go somewhere and <button type="button"> to do something; the class styles either.
- An icon inside a button is aria-hidden. The text is the name.
- Focus shows the select ring from globals.css. Never remove it.
CSS
The rules, as globals.css has them, with the reasoning the stylesheet keeps beside them.
@layer components {
/*
* The two buttons the site ships. The specimen used to document a larger
* pair that appeared nowhere; these are the thirty-four call sites. The
* hover rules sit under (hover: hover) because every Tailwind hover on the
* site does (a tapped control must not latch). Law 04 holds for a hover as
* it does for a card: the primary lifts a pixel, it does not dim, and the
* secondary takes a fill.
*/
.aka-button,
.aka-button-secondary {
display: inline-flex;
width: fit-content;
align-items: center;
gap: 0.375rem;
border-radius: var(--radius);
border: 1px solid var(--border);
padding: 0.5rem 0.875rem;
font-size: 13px;
font-weight: 500;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: var(--dur-ink);
}
.aka-button {
background-color: var(--foreground);
color: var(--background);
transition-property: transform;
transition-duration: var(--dur-lift);
transition-timing-function: var(--ease-lift);
}
.aka-button-secondary {
background-color: var(--background);
color: var(--foreground);
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
}
@media (hover: hover) {
.aka-button:hover {
transform: translateY(-1px);
}
.aka-button-secondary:hover {
background-color: color-mix(in srgb, var(--muted) 40%, transparent);
}
}
}
@layer components {
@media (prefers-reduced-motion: reduce) {
.aka-button:hover {
transform: none;
}
}
}