Foundations
Layout & grid.
Every Tetrifox screen begins with the same constraints: close the frame, quantize the space, assemble from cells. Layout is not decoration around content — it is the system the interface grows from.
01 / Structure
The closed grid.
Close every edge. Each region has one border owner.
gap-px bg-border supplies the internal hairlines.One frame owner
The section closes the region; its cells only contribute the dividers between neighbours.
Floating edge
Open on two sides, so the structure never resolves.
The rules
- Must
Close every edge. Each line meets a neighbour or the frame; build divided layouts from
Section,CellandGridRow, not ad-hocgrid gap-*or flexbox. - Must not
Add a second outer
border border-borderto a specimen inside an already-framed region. Continue the matrix withgap-px bg-border, or separate parts with only theborder-t/border-lthey need.--border - Must
Keep borders structural: 1px hairlines in
--borderor--border-subtle.--border--border-subtle - Prefer
Reserve self-contained micro-frames for small teaching diagrams whose border is the lesson: Layout specimens, Logo clearspace and incorrect-use examples, compact Mino diagrams.
02 / Rhythm
Spacing lattice.
Quantize every measure: a 4px base, an 8px rhythm, nine legal steps.
State 2 / 4 · measured
The nine legal steps
14pxMicro-gap28pxStack gap312pxCompact control416pxMobile cell inset624pxContent rail832pxGroup gap1248pxDesktop rail1664pxSection rhythm2496pxGenerous sectionContent rail24 → 32 → 48Primary content aligns at px-6, md:px-8, and lg:px-12.Cellstandard / sectionSemantic padding modes keep inset and vertical rhythm consistent.Rhythm8 / 32 / 64→96Stack gap, group gap, and section spacing.The rules
- Must
Use only the nine lattice steps — Tailwind
1, 2, 3, 4, 6, 8, 12, 16, 24(4 to 96px) — for padding, margin and gaps. - Must not
Use the
.5half-steps:p-1.5(6px),gap-2.5(10px),py-3.5(14px). - Must
Align primary text, captions, labels, tables, controls, Header and Footer to the content rail
px-6 md:px-8 lg:px-12(24 → 32 → 48px). The compact navigation Rail is the one exception. - Must
Use
Cell padding="standard"orpadding="section"and do not add competingp-*orpx-*classes to a padded Cell.padding="none"is for full-bleed visuals. - Prefer
Use
gap-2between stacked items,gap-8between groups, andpy-16 md:py-24for section rhythm.
03 / Frame
Frame & containers.
Let the viewport be the frame, and cap the measure inside the cell.
State 3 / 4 · full-bleed shell
Legacy container · do not use
max-w-7xl
The rules
- Must
Let the viewport be the frame: no outer gutters and no centred
max-w-* mx-autocolumn around the interface. - Must
Cap reading measures inside content (
max-w-md,max-w-xl,max-w-3xl) for readability on wide screens. - Must
Pin the Rail (
w-64,border-r) to the left edge, span a sticky Header (border-b) and a Footer (border-t) full width, and let<main>fill the rest. No border above the header or below the footer.
04 / Assembly
Cellular primitives.
Change the viewport below to see the same rules recompose without changing vocabulary.
State 4 / 4 · responsive assembly
1280px. The Rail joins the frame and row dividers move to the left.
<Section>border-bA full-bleed band. Stack sections to continue the vertical lattice.<Cell>24 / 32 / 48The canonical content rail; borders stay with the parent.<GridRow>border-t → border-lOne responsive divider changes orientation when the cells form a row.<StatusMark>gap / draft / shippedA square state marker: hollow, muted, or brand-filled.Constraints this explicit let an interface grow without visual drift. Three primitives, one square mark, nine spacing steps. This page is assembled from exactly that set—nothing here is decoration.
The rules
- Must
Assemble from three primitives:
Section(a full-bleed band with a bottom hairline),Cell(padding, no borders) andGridRow(one divider that stacks asborder-tand becomesborder-lin a row). - Must
Draw status markers as squares, never circles: hollow for gap, muted fill for draft, brand fill for shipped.