Menu

Foundations

Layout

Three widths, Tailwind's breakpoints and one gutter. A page picks the width its content reads at, and nothing on the site measures the device.

Widths and breakpoints

ClassValueUsed for
max-w-2xl672pxWrite-ups: one column of prose
max-w-3xl768pxReference pages, galleries, this column
max-w-site1180pxLanding, project index, the docs frame
ClassValueUsed for
sm:640pxOne column to two
md:768pxStacked hero to side by side
lg:1024pxTwo columns to three; the docs sidebar
xl:1280pxThe docs’ On this page column

No device sniffing. Layout responds to width; touch-specific behaviour responds to pointer: coarse and hover. There is no isMobile anywhere in any repo running this system.

Helpers

Two classes: the gutter every page sits inside, and the block that takes the site's width from inside a reading column.

site-inset

resize the window: the gutter widens by breakpoint

The content edge.

.aka-breakout gives a block the site width and splits the difference across both margins, which go negative on their own. It is not run here, because this column sits beside a sidebar: a breakout is for the write-up column, where the page is empty on either side. The rule says why it is written the way it is.

app/globals.css, line 444
@layer components {
  .site-inset {
    @apply px-5 sm:px-6 md:px-12 lg:px-16;
  }

  /*
   * A block that takes the site's width from inside the reading column.
   *
   * Give the block the site width, then split the difference between it and
   * the column across both margins: the margins go negative on their own,
   * stay symmetrical, and `min()` against the viewport shrinks the block into
   * the gutter on a narrow window instead of opening a scrollbar, so there is
   * no separate mobile rule to keep in sync. 1180px is `max-w-site`, the
   * width the project plates take on the landing and on /demo, so a reader
   * meets the same grid here rather than a third measure invented for one
   * page. Written once here; it used to be an inline style copied into three
   * write-ups.
   */
  .aka-breakout {
    --breakout: min(100vw - 3rem, 1180px);
    width: var(--breakout);
    margin-inline: calc((100% - var(--breakout)) / 2);
  }
}