stnd.build

Responsive & Mobile Architecture

Harmonic typographic scaling, zero-hack fluid containers, mobile baseline rhythm, and Apple touch ergonomics.

Proportion preserves dignity across screens. A design system does not adapt by scattering arbitrary clamp() formulas, breakpoint overrides, and micro-patches across fifty CSS files. In Standard, responsive behavior is architectural, mathematical, and token-driven: the entire system contracts and expands in unison through a small set of foundational dials.

The living specimen of this architecture is published at stnd.build and stnd.gd — resize your viewport or open the site on an iPhone or iPad to observe the continuous optical compression in real time.


1. The Philosophy of Zero-Hack Responsiveness

In traditional CSS frameworks, responsive design often deteriorates into a battle of ad-hoc media queries and isolated font clamps:

/* ❌ Anti-pattern: Fracturing the typographic scale with arbitrary clamps */
.hero-title {
  font-size: clamp(2rem, 5vw, 5.5rem); // Breaks the modular scale ratio!
}
.section-heading {
  font-size: clamp(1.5rem, 3vw, 3rem); // Independent curve; ratio lost!
}

When individual classes clamp themselves independently, the mathematical harmony between headings, body text, and micro-labels is shattered. A level-1 title might scale at 5vw while an adjacent subhead scales at 3vw, causing titles to crowd subheadings on tablets or dwarf them on mobile.

Standard rejects local clamps and patches:

  1. Vanilla-First: Components declare pure design tokens (font-size: var(--scale-5, var(--scale-4))).
  2. Systemic Compression: When the viewport crosses into mobile or tablet boundaries, the framework adjusts the underlying scale generator (--optical-ratio), causing every heading and display size across the entire application to contract gracefully together.
  3. Harmonic Cadence: Spacing, margins, and reading column boundaries collapse along the exact same vertical baseline rhythm (--space / 1rlh).

2. Breakpoint Grid & Fluid Boundaries

Standard defines four canonical breakpoints configured in _standard-00-variables.scss:

Breakpoint SCSS Variable CSS Token Viewport Range Primary Behavior
Mobile $mobile --breakpoint-mobile < 640px Single-column stack, full-width touch ergonomics, 44px hit targets.
Small (Tablet) $small --breakpoint-sm < 768px Harmonic ratio compression activates; prose breakouts collapse.
Large (Desktop) $large --breakpoint-lg > 1024px Multi-column Swiss grid, sidebars, expanded reading gutters.
Wide (Cinema) $wide --breakpoint-wide > 1440px Physics slope activation (--fluid-growth expands base text smoothly).
flowchart LR
  subgraph Mobile["< 640px Mobile"]
    M1["Single Column Stack<br>--hit-target: 44px<br>--font-size: 1.125rem (no iOS zoom)"]
  end
  subgraph Small["< 768px Small / Tablet"]
    S1["Harmonic Ratio Shift<br>--optical-ratio: 1.272<br>--page-padding: var(--space-d2)<br>Breakouts: 0px"]
  end
  subgraph Desktop["768px - 1440px Desktop"]
    D1["Canonical Silver Scale<br>--optical-ratio: 1.414<br>12-Column Swiss Grid<br>--page-padding: clamp(1rem, 6vw, 4rem)"]
  end
  subgraph Wide["> 1440px Ultra-Wide"]
    W1["Fluid Physics Growth<br>--fluid-growth expands base<br>Max container: 1400px"]
  end

  Mobile --> Small --> Desktop --> Wide

3. Harmonic Typographic Scaling (--ratio-mobile)

The engine powering Standard’s typographic scale is the optical modular ratio:

$$\text{Size}_N = \text{Base} \times (\text{Optical Ratio})^N$$

On desktop, the default optical ratio is the Silver Ratio ($\sqrt{2} \approx 1.414$). With an initial base size of 16px, --scale-5 expands to approximately 90px — commanding and architectural on a 27-inch display, but disastrous on a 390px iPhone screen where it would truncate words or push body copy below the fold.

Rather than hacking --scale-5 with a custom clamp, the framework modulates the scale factor on screens under $small (768px):

/* packages/styles/_standard-01-token.scss */
@media only screen and (max-width: #{$small}) {
  #{$stnd-theme-scope},
  :root[data-theme],
  [data-theme] {
    --optical-ratio: var(--ratio-mobile, var(--ratio-halfstep));
    --font-size: var(--font-size-mobile);
    --page-padding: var(--page-padding-small, var(--space-d2)) !important;
    --prose-full: 0px !important;
    --prose-wide: 0px !important;
    --prose-inset: 0px !important;
  }
}

By switching --optical-ratio to --ratio-halfstep ($1.272$), the entire scale contracts in exact mathematical proportion:

Token Role Desktop Size (1.414) Mobile Size (1.272) Responsive Behavior
--scale-5 Hero Display / Main Title ~90.5px (5.65rem) ~42.4px (2.65rem) Fits cleanly on 320px screens without line collision
--scale-4 Article Heading (H1) ~64.0px (4.00rem) ~33.3px (2.08rem) Balanced 2-line title on portrait mobile
--scale-3 Section Heading (H2) ~45.3px (2.83rem) ~26.2px (1.64rem) Clear hierarchy above body paragraphs
--scale-2 Subsection Heading (H3) ~32.0px (2.00rem) ~20.6px (1.29rem) Compact subhead
--scale Body Base Text 16px (1.00rem) 18px (1.125rem) Boosted to --font-size-mobile to prevent iOS zoom
--scale-d2 Captions & Helper Text ~11.3px (0.71rem) ~14.1px (0.88rem) Legible annotations anchored above 9px floor

Because this shift occurs at the root token layer, all application markup remains 100% vanilla:

<!-- apps/stnd.build/modules/manual/layout/Manual.astro -->
<h1 class="manual-title">{title}</h1>

<style>
  .manual-title {
    font-size: var(--scale-5, var(--scale-4));
    line-height: var(--line-height-compact);
    /* Zero media queries or clamp() hacks required! */
  }
</style>

4. Mobile Gutter Cadence (--page-padding-small)

On desktop viewports, Standard provides generous breathing room:

--page-padding: clamp(1rem, 6vw, 4rem);

On mobile devices, wide margins waste precious screen width, while zero margin forces text into contact with curved glass bezels and device home indicators.

Standard introduces --page-padding-small: var(--space-d2) (half of the baseline rhythm unit, typically ~10–12px).


5. Flattening Prose Breakout Tracks

Standard’s reading column uses a CSS Grid model with three breakout tracks:

On mobile screens ($\le 768px$), these breakout tracks automatically flatten:

--prose-full: 0px !important;
--prose-wide: 0px !important;
--prose-inset: 0px !important;

This ensures that wide tables, code blocks, and diagrams comfortably utilize 100% of the mobile viewport width without triggering unintended horizontal scrollbars.


6. Touch Targets & Apple HIG Ergonomics

Interfaces built with Standard respect Apple Human Interface Guidelines and Web Content Accessibility Guidelines (WCAG):

  1. Minimum Touch Area (--hit-target: 44px;):
    • Small visual controls (e.g. 28px icon buttons) enforce a 44px hit-target boundary via invisible pseudo-element expansion (::before).
    • Fingers on touchscreens reliably trigger buttons without mis-taps.
  2. Control Height Scale:
    • Small controls: --control-height-sm: 28px.
    • Standard controls: --control-height-md: 32px.
    • Prominent controls: --control-height-lg: 40px.
  3. Native iOS Input Zoom Prevention (--font-size-mobile: 1.125rem):
    • Mobile Safari automatically zooms the page when an input field has an effective font size smaller than 16px.
    • Standard anchors mobile body text and form inputs to 1.125rem (18px), eliminating erratic page zooming while providing effortless readability.

7. The Fluid Swiss Grid on Mobile

Standard’s 12-column Swiss grid system folds cleanly across responsive viewports using mobile-first utility classes:

<div class="grid col-gap-2">
  <!-- 4 columns on desktop, full-width stack on mobile -->
  <div class="col-4 sm:col-12">Feature 1</div>
  <div class="col-4 sm:col-12">Feature 2</div>
  <div class="col-4 sm:col-12">Feature 3</div>
</div>