The voice¶
Added in 1.0. 1.x proved colour and had no opinion about type, which is why it was correct and anonymous. A palette is not a look. What people recognise across Linear, Stripe, Notion and Geist is typographic, and none of those systems can prove they still follow their own rules.
@import 'nilam/voice.css'; /* the type layer */
@import 'nilam/layout.css'; /* the layout grammar */
Both are in nilam/nilam.css already. Nothing here changes a colour token.
No font is shipped¶
Every stack names the face nilam was drawn against, then falls all the way to a generic:
| Token | Names | Falls back to |
|---|---|---|
--font-ui |
Inter | system-ui, then sans-serif |
--font-display |
Inter Tight | system-ui, then sans-serif |
--font-mono |
JetBrains Mono | ui-monospace, then monospace |
Install the named face and you get the intended thing. Do not, and you get San Francisco or
Segoe, which were drawn by the same school. What you never get is a network request, a layout
shift, or a licence question. Asserted: no @font-face, no URL, and every stack ends in a
generic family.
The four rules¶
1. The display face is allowed on one surface. Exactly one selector, .n-display, may set
font-family: var(--font-display), and no component may set it at all. The moment a second
face reaches buttons and labels, the page stops having a hierarchy and starts having a costume.
2. Every measured number is a readout. .n-readout is mono and tabular, with a .n-eyebrow
above it saying what was measured. Tabular figures are not a nicety: without them a counter's
digits change width as it counts and the row twitches.
3. Tracking tightens as size grows. Six steps from --tracking-1 at 0em to
--tracking-display at −0.036em, asserted monotone. This is the single most reliable difference
between type that looks designed and type that looks defaulted.
4. Emphasis is 510, not bold. --weight-emphasis sits between regular and medium on a
variable grotesk: enough to separate a label from its value, not enough to read as shouting.
<span class="n-eyebrow">Assertions</span>
<b class="n-readout">29,969</b>
<h1 class="n-display">Colour, proven. Now <em>lit</em>.</h1>
The second face is one class¶
.n-paper swaps the display face for a serif and warms the ground. The body face does not
change, because a serif body at UI sizes is a website from 2009. Same stylesheet, same
components, same tokens.
Compare demo/voice/system.html and demo/voice/system-paper.html: both are built from nothing
but the shipped stylesheet and .n-* classes, and the only difference between them is that
class.
The trap that trimming sets¶
.n-display uses text-box-trim, so a headline's cap sits exactly on its box and you can
align type to a rule without a magic negative margin. It also removes the half-line of air
every other block in CSS quietly relies on.
Measured on the editorial demo: a trimmed headline ending in "not glass." landed the tail of its g on the paragraph below. Two things fix it, and both ship:
.n-displaycarriesmargin-block-end: 0.22em, in em because descender depth scales with the type and a fixed 24px is right at 108px and wrong at 40px..n-stack-flowgives a display heading more room either side, not less.
Asserted: if the voice layer trims a text box, the layout layer must have a flow rule naming
.n-display.
The layout grammar¶
Twelve primitives, and one rule that separates them from every other set.
They query their own box, never the window¶
Every primitive is a container, and every adaptation is a @container query. nilam.layout.css
contains zero viewport media queries, and the suite fails if one appears.
A viewport breakpoint can say "the window is 400px, so stack the card". It cannot say anything about a card that is 400px wide inside a 1600px window, which is the case in every sidebar, split pane, dashboard cell and modal ever built. That is why systems built on breakpoints ship components that look right on a phone and broken in a drawer.
| Primitive | What it is |
|---|---|
.n-shell |
rail + main + inspector, shedding panels as it narrows |
.n-sidebar |
two columns until there is no room, then one |
.n-switcher |
a row that becomes a column on its own width |
.n-grid, .n-grid-aligned |
a responsive grid; the aligned variant uses subgrid |
.n-bento |
a grid where named cells are deliberately larger |
.n-center |
the measure, in ch, so it follows the font |
.n-stack-flow |
vertical rhythm, tighter after a heading |
.n-cover, .n-frame, .n-reel |
full height, fixed ratio, snapping row |
.n-ruled, .n-ruled-cols |
hairlines where other systems reach for a card |
.n-lit |
the edge that catches the light from where the sun is |
An element cannot query its own size. The shell was written first as
@container { .n-shell { grid-template-columns: … } }, which asks the shell's ancestor about
its width and silently never fires. The tracks are now auto with the widths on the panels, so
hiding a panel collapses its track. Asserted: no @container rule may target a container.
Cards in a row, actually aligned¶
Each child spans three rows of the parent's grid and adopts them with grid-template-rows:
subgrid, so every heading shares a band and every footer sits on one line, whatever the
content length. Baseline in all three engines since 2023, and almost nobody ships it.
Springs¶
--spring-snap, --spring-settle, --spring-glide, each with a matching -dur.
A cubic-bezier cannot overshoot, which is why CSS motion has looked like CSS for fifteen years.
These are real damped-harmonic springs sampled into linear(), solved by src/spring.mjs and
re-derived by the suite, so a digit cannot drift.
The knobs are Apple's two, duration and bounce, rather than mass, stiffness and damping, which interact and which nobody can hold in their head.
The finding worth knowing: linear() describes a shape over normalised time, so sampling a
spring at u·duration with ω0 = 2π/duration cancels the duration exactly. Two springs with
the same bounce emit byte-identical easings. The shape is bounce alone. The duration ships
beside each one because a shape used with the wrong time is what makes motion feel cheap.
Asserted in CI: nothing outside a loader runs past 300ms, and nothing anywhere uses ease-in,
which delays the exact moment a person is watching.
Limits¶
text-box-trimneeds Chrome 133, Safari 18.2. Firefox ignores it and the type is merely less tight. Nothing breaks.- Container queries are Baseline, but
@containerstyle queries are not, and nothing here uses them. linear()cannot carry velocity across an interruption. A spring retargeted mid-flight restarts rather than continuing. For dialogs, switches and menus nothing is retargeted mid-flight. Anything drag-driven wants a real spring in JavaScript.- The 510 weight needs a variable face. On a static one it rounds to 500.