Skip to content
OAIT Design System

Design system / Foundations

Layout

How space, width, columns, chrome, and layers work across the OAIT family: one 4px grid, five window classes, one page frame, and one shell for every product.

Every spacing, size, layer, breakpoint, and container value on this page is a token from the token reference, and the few measured values say so; the rules come from the canonical rules (§4, §11) and carry their decision IDs, which the decision log explains. Layout owns five token families: spacing, size, z-index layers, breakpoints, and containers (D-ARC-01).

How to read the names:

  • Tailwind CSS v4 utilities come from tokens/tailwind.css (px-gutter, max-w-page, h-18, z-30). Plain CSS reads the variables in tokens/oait.css (var(--space-gutter), var(--container-page), var(--size-header), var(--z-header)). The numeric Tailwind steps and the tokens are identical: h-14 is --size-field, z-30 is --z-header.
  • Breakpoint names are written plain (sm, md, lg, xl, 2xl): they are the Tailwind prefixes of a class such as md:grid-cols-2, and the CSS tokens --breakpoint-sm … --breakpoint-2xl.
  • The reference CSS names the same recipes as classes (.oa-container, .oa-grid, .oa-split) in base.css; the shells, bars, and sheets are their components' classes.
  • Pixel values on this page assume the browser's default root size, 1rem = 16px. Never set html { font-size }: every rem breakpoint and container assumes it, and a person's own larger default then scales them all together (D-LAY-01, D-LAY-02).

The short version

  1. Space comes in 4px steps from one scale; roles use the semantic tokens (p-card, gap-fields, py-section) (D-LAY-01, D-LAY-10, D-LAY-11).
  2. Mobile first, five window classes on Tailwind's default breakpoints; md (768px) is the one navigation switch (D-LAY-02).
  3. Every page sits in the page frame mx-auto w-full max-w-page px-gutter sm:px-gutter-medium, and the header uses the same frame: at 1440px every product's content starts at x = 104 (D-LAY-03, D-LAY-04).
  4. Cards go 1 → 2 → 3 columns, tiles 2 → 4, with a 16px gap; the marketing split is 1.05fr 1fr from lg with the text first (D-LAY-07, D-LAY-08, C-5).
  5. Every control is at least 48×48px; smaller visuals extend their hit area (D-LAY-12, D-ARC-05).
  6. App shells are a h-dvh grid: bars are grid rows, only <main> scrolls (D-LAY-09).
  7. z-index comes only from the nine-step ladder, −1 to 80 (D-LAY-16, D-ARC-26).
  8. dvh only, never vh; viewport-fit=cover and safe-area padding on every product (D-LAY-17).
  9. Logical properties everywhere; the safe-area insets are the one physical exception (D-LAY-17, D-BCP-30).
  10. Comfortable density everywhere; compact only in consoles from md, and it never touches targets, gutters, or the spacing scale (D-LAY-18).

Spacing

The 4px grid

Tailwind's base is --spacing: 0.25rem, so every numeric step is n × 4px (p-4 is 16px). Plain CSS uses var(--space-<n>). These are the only steps (D-LAY-01).

Step px Tailwind CSS Typical use
0 0 p-0, gap-0 --space-0 No space
0.5 2 gap-0.5 --space-0-5 Half step, inside components only: indicator and eyebrow rules, the block padding of tiny badges
1 4 gap-1 --space-1 Helper or error text under a field; icon to label in a navigation destination
1.5 6 gap-1.5 --space-1-5 Half step, inside components only: a small icon and its label in chips and inline links; a field label above its box
2 8 gap-2 --space-2 Title and supporting text, label and value, the buttons of a dialog footer, chips in a row (same value as stack-tight)
2.5 10 gap-2.5 --space-2-5 Half step, inside components only: the mark-to-name gap of the M lock-up
3 12 gap-3 --space-3 The hero CTA row, table cell inline padding, the gap inside a header row
3.5 14 px-3.5 --space-3-5 Half step, inside components only: the inline padding of a text button inside a snackbar
4 16 gap-4 --space-4 Compact gutter, grid gap, groups inside a card (same value as gutter, grid, stack)
5 20 p-5 --space-5 Card padding on compact windows, the gap between form fields (same value as card, fields)
6 24 p-6 --space-6 Gutter from sm, card padding from sm, dialog and sheet padding, blocks inside a container (same value as gutter-medium, card-medium, stack-loose)
7 28 px-7 --space-7 Inline padding of 56px buttons; never a card padding
8 32 gap-8 --space-8 Groups on an app page from md, an app section's heading to its content, fieldsets of a long form (same value as stack-group)
10 40 px-10 --space-10 Panel inline padding from sm, the stacked split gap, auth card block padding (same value as split)
12 48 py-12 --space-12 Heading block to content, the split gap from lg, hero panel block padding below lg (same value as section-head, split-expanded)
14 56 sm:py-14 --space-14 The auth frame's panel block padding from sm
16 64 lg:px-16 --space-16 Panel inline padding from lg, feature panel block padding from lg
18 72 h-18, min-h-18 --space-18 A size, not a padding: the header height and two-line rows
20 80 py-20 --space-20 Section rhythm below lg, hero panel block padding from lg (same value as section)
24 96 bottom-24 --space-24 The snackbar's distance above a bottom bar (the scroll offset under a sticky header is --size-scroll-offset)
28 112 py-28 --space-28 Section rhythm from lg (same value as section-expanded)

Rules:

  • Use only these steps. 36px is off the scale (mt-9 becomes mt-8, size-9 becomes size-10), and so is every value between steps (D-LAY-01).
  • Half steps (2, 6, 10, and 14px) are for component internals only; they never space layout blocks (D-LAY-01).
  • Where a role has a semantic token (below), write the semantic token, not the number: p-card sm:p-card-medium, not p-5 sm:p-6. The recipes on this page do (D-LAY-10, D-LAY-11).
  • Write logical properties: ps-6, pe-4, ms-auto, start-4, text-start. Physical left and right appear only in safe-area padding (D-LAY-17, D-BCP-30).

Semantic spacing

Each semantic token is a Tailwind spacing name (--spacing-<name>, so px-gutter, gap-fields, py-section) and a CSS variable (--space-<name>) (D-LAY-10, D-LAY-11).

Token px Tailwind CSS Role
gutter 16 px-gutter --space-gutter Page side padding below sm
gutter-medium 24 sm:px-gutter-medium, gap-gutter-medium --space-gutter-medium Page side padding from sm; the gap between app panes
section 80 gap-section, py-section --space-section Between landing sections, or a band's block padding, below lg
section-expanded 112 lg:gap-section-expanded, lg:py-section-expanded --space-section-expanded The same from lg
section-head 48 mt-section-head --space-section-head A marketing section's heading block to its content
split 40 gap-split --space-split The marketing split's gap while stacked
split-expanded 48 lg:gap-split-expanded --space-split-expanded The split's gap side by side
card 20 p-card --space-card Card padding below sm
card-medium 24 sm:p-card-medium, p-card-medium --space-card-medium Card padding from sm; dialogs and sheets at every width
row-inset 16 px-row-inset --space-row-inset Inline padding of list, menu, and drawer rows; the end padding of every row
row-inset-medium 24 sm:ps-row-inset-medium --space-row-inset-medium The start padding of full-width list rows from sm, so row text lines up with card padding
fields 20 gap-fields, space-y-fields --space-fields Between form fields (label, control, and message count as one field)
stack-tight 8 gap-stack-tight --space-stack-tight Inside a text group: title and supporting text, label and value, list items
stack 16 gap-stack --space-stack Between groups inside a card or section: title to lead, paragraphs; a section header's eyebrow sits 12px (--space-3) above its title (Section header)
stack-loose 24 gap-stack-loose --space-stack-loose Between blocks of a container (card, dialog, sheet, auth card), above its action row, and between blocks of an app page below md
stack-group 32 md:gap-stack-group, gap-stack-group --space-stack-group Between groups of an app page from md, an app section's heading and its content, the fieldsets of a long form
grid 16 gap-grid --space-grid Between cards and tiles in a grid, at every width
stage-safe 72 p-stage-safe --space-stage-safe Product note (Games): the title-safe margin of the 1920×1080 stage artboard

Tailwind v3 products get the same names from tokens/tailwind.preset.cjs (px-gutter, gap-fields, py-section).

Breakpoints and window classes

The breakpoints are Tailwind's defaults, read as Material 3 window size classes. Write styles mobile first with min-width; nothing sits below sm, so every base style works from a 320px window (WCAG 1.4.10) (D-LAY-02).

Window class Range Prefix Token Material 3 class it stands for
compact 0–639px (none) — compact, below 600
medium 640–1023px sm --breakpoint-sm 40rem medium, 600–839
medium, from the navigation switch 768–1023px md --breakpoint-md 48rem —
expanded 1024–1279px lg --breakpoint-lg 64rem expanded, 840–1199
large 1280–1535px xl --breakpoint-xl 80rem large, 1200–1599
extra-large 1536px and up 2xl --breakpoint-2xl 96rem extra-large, 1600 and up

What changes at each breakpoint (D-LAY-02, D-LAY-03, D-LAY-07, D-LAY-08, D-LAY-09, D-LAY-10, D-LAY-11, D-LAY-14, D-ARC-28):

From What changes
base (compact) Gutter 16px. Cards one column, tiles two. Splits stacked with a 40px gap, text first. Hero buttons stacked at full width. Card padding 20px. Site header: the S lock-up (32px mark), the 48px Global ID circle, the 48px menu button; the language switcher and "Sign in" move into the menu sheet. Member app: the 64px app bar and the 80px bottom bar. Console: the 72px app bar and the 48px "Menu" row. Modals are bottom sheets; popovers are bottom sheets too. Sections 80px apart
sm, 640px Gutter 24px. Cards two columns. Card padding 24px; list rows start at 24px. Hero buttons sit side by side. Panel and auth-card inline padding 40px. The M lock-up (40px mark, with its sub-line where the product has one); the site header's end cluster returns to the bar, and an item the 640px bar cannot hold stays in the menu sheet up to 768px (Site header). Popovers float again
md, 768px: the navigation switch Bottom bar → navigation rail (96px); the console's "Menu" sheet → navigation drawer (272px). Bottom sheet → dialog. The member app bar 64 → 72px. App shell <main> padding 16 → 24px; app page gaps 24 → 32px. Compact density may start in consoles. The snackbar moves to 24px from the inline start
lg, 1024px Splits side by side (1.05fr 1fr, 48px gap). The site header shows its navigation and drops the menu button. Cards three columns, tiles four. Sections 112px apart. Panels pad 64px inline; hero panels 80px block, feature panels 64px. Side columns appear: the 272px filter column and the 320px action aside; the sticky action bar goes
xl, 1280px The page frame reaches its 1280px cap; nothing else changes by default
2xl, 1536px No layout change by default; consoles may use the wide container

Rules:

  • md (768px) is the one navigation switch for every product (D-LAY-02, D-CSN-13).
  • Use the max- variants (max-sm:, max-md:) only to undo something a base style set (D-LAY-02).
  • One height query exists: the short variant, (max-height: 30rem) (landscape phones and 200–400% zoom). It turns sticky chrome static with short:static. tokens/tailwind.css declares it and the v3 preset defines it as a screen (D-LAY-17, D-ARC-30); a product that does not import either writes @custom-variant short (@media (max-height: 30rem)); itself.
  • Components that sit in columns of different widths (cards, the ID card) respond to their container with @container and Tailwind's @xs … @7xl, or size themselves in cqw; never to the window (D-LAY-02, D-LAY-19).
  • The container tokens also generate container-query variants such as @page: and @form:. Never use them (D-LAY-02).
  • Plain CSS cannot read a variable inside a media query, so it writes the literal rem values (D-LAY-02):
@media (min-width: 40rem) { /* sm, 640px: gutter 24, two-column cards */ }
@media (min-width: 48rem) { /* md, 768px: the navigation switch */ }
@media (min-width: 64rem) { /* lg, 1024px: splits, three-column cards, side columns */ }
@media (min-width: 80rem) { /* xl, 1280px: the page frame is capped */ }
@media (min-width: 96rem) { /* 2xl, 1536px */ }
@media (max-height: 30rem) { /* short: sticky headers and bars turn static */ }

Portrait tablets of 744–767px (iPad mini) stay below md and keep phone navigation: a bottom bar and bottom sheets, where Material 3 would give a rail. This is intended; field-test it in Global ID's device runs before changing the switch (D-LAY-02).

Gutters and containers

Gutters

  • The gutter is 16px below sm (px-gutter) and 24px from sm at every larger class (sm:px-gutter-medium) (D-LAY-03).
  • Safe-area insets go on the full-bleed parent, so the effective side padding is the gutter plus env(safe-area-inset-left) or env(safe-area-inset-right) (see Safe areas) (D-LAY-03, D-LAY-17).
  • No fluid gutters (clamp()), no wider gutters, no bleed: panels, the inverse band included, stay inside the gutter, never -mx-2. Only the full-bleed tinted band spans the window, with its own page frame inside (D-LAY-03, D-LAY-10, D-LAY-11).

Containers

Containers hold their gutters inside (box-sizing: border-box): a 1280px window shows 1232px of content in the page frame (D-LAY-04, D-LAY-05, D-LAY-06, D-ARC-24).

Token Value Tailwind CSS Use
page 80rem, 1280px max-w-page --container-page Every page frame and the header above it. Same value as max-w-7xl: write max-w-page
wide 88rem, 1408px max-w-wide --container-wide Consoles, dashboards, data tables. Never for reading text
reading 48rem, 768px max-w-reading --container-reading Long-form pages (privacy, terms, help, safety) and the heading block of a section; 720px of text from sm
measure 42rem, 672px max-w-measure --container-measure The longest line of paragraphs, leads, and intros, inside any container (about 70–80 characters of 16–18px text)
form 28.75rem, 460px max-w-form --container-form The outer width of the auth card (its padding inside) or of a bare form column; install, offline, and empty-state columns
dialog 35rem, 560px max-w-dialog --container-dialog The widest a dialog or bottom sheet gets; below it a dialog is w-[calc(100%-2rem)] and a sheet spans the window
snackbar 37.5rem, 600px max-w-snackbar --container-snackbar The widest a snackbar gets; below it the snackbar keeps 16px from the window edges (24px from md)
side-sheet 24rem, 384px max-w-side-sheet --container-side-sheet The widest a modal side sheet gets (the phone menu, the console drawer below md); below it w-[85vw]
menu 20rem, 320px max-w-menu --container-menu The widest a menu, dropdown, or popover gets; they start at min-w-50 (--size-menu-min, 200px)
tooltip 15rem, 240px max-w-tooltip --container-tooltip The widest a plain tooltip gets

Where content starts in the frames that hold gutters (x from the window's inline start, then the content width; measured in Chromium):

Frame 390px window 834px window 1440px window
page x 16, 358 wide x 24, 786 wide x 104, 1232 wide
wide x 16, 358 x 24, 786 x 40, 1360
reading x 16, 358 x 57, 720 x 360, 720

Boxes that carry their padding inside: a max-w-form column or auth card is a 460px box centered at x 187 (834px window) and x 490 (1440px); a dialog box is x 16, 358 wide at 390px (w-[calc(100%-2rem)]), x 137 at 834px, and x 440 at 1440px, 560 wide.

The page frame

<div class="mx-auto w-full max-w-page px-gutter sm:px-gutter-medium">…</div>
Frame Tailwind v4 Reference CSS Plain CSS
Page mx-auto w-full max-w-page px-gutter sm:px-gutter-medium .oa-container margin-inline: auto; width: 100%; max-width: var(--container-page); padding-inline: var(--space-gutter), and var(--space-gutter-medium) from 40rem
Console mx-auto w-full max-w-wide px-gutter sm:px-gutter-medium .oa-container--wide the same with var(--container-wide)
Long-form page mx-auto w-full max-w-reading px-gutter sm:px-gutter-medium .oa-container--reading the same with var(--container-reading)
One-step form or utility page mx-auto w-full max-w-form px-gutter sm:px-gutter-medium .oa-container--form the same with var(--container-form)
Paragraph cap max-w-measure .oa-measure max-width: var(--container-measure)

Rules:

  • One edge per page. The header uses the container of the page under it, so the lock-up and the content share one edge: at 1440px every product's content starts at x = 104. Full-bleed frames (Global ID's auth frame, the app shells) have a full-width header with the gutter (D-LAY-04).
  • Never nest page frames. Inside a frame, cap paragraphs with max-w-measure and heading blocks with max-w-reading (D-LAY-04, D-LAY-05).
  • Inside an app shell the content in <main> caps at max-w-page, or max-w-wide in consoles; <main> itself supplies the gutter (D-LAY-04, D-LAY-09).
  • Paragraphs cap at max-w-measure, never max-w-prose: 65ch moves with the typeface (585px in Roboto Flex, 666px in Figtree) (D-LAY-05, D-ARC-34).
  • Display text keeps its em caps, which scale with their own size: hero headings 13em and the hero lead 30em; a section header's lead stops at max-w-measure (canonical §10.27) (D-LAY-05, D-ARC-34).
  • A task that needs more than about three fields, or more than 560px, is a page, not a dialog (D-LAY-06, D-CSN-21).
  • Never Tailwind's container class (D-LAY-04).

Grids and splits

Pattern Tailwind v4 Reference CSS Notes
Card grid grid gap-grid sm:grid-cols-2 lg:grid-cols-3 .oa-grid 1 → 2 → 3 equal columns
Tile grid (stats, apps, short features, steps) grid grid-cols-2 gap-grid lg:grid-cols-4 .oa-grid--tiles 2 → 4 columns; tiles that hold a sentence: grid gap-grid sm:grid-cols-2 lg:grid-cols-4
Marketing split (hero, feature, contact) grid items-center gap-split lg:grid-cols-[1.05fr_1fr] lg:gap-split-expanded .oa-split Text column first; the art column is the product slot
List with filters grid gap-gutter-medium lg:grid-cols-[var(--size-nav-drawer)_minmax(0,1fr)] — A 272px filter column beside the results
Detail with aside grid gap-gutter-medium lg:grid-cols-[minmax(0,1fr)_var(--size-side-pane)] — The content beside a 320px action aside

Rules:

  • The grid gap is 16px (gap-grid) at every width. Global ID's 24px gap from lg retires (D-LAY-07).
  • No auto-fit or auto-fill grids: columns follow the window classes, so every product changes columns at the same widths (D-LAY-07).
  • Write minmax(0,1fr) for the flexible column, so a long word, an email, or a wide table cannot widen it past the window (D-LAY-09).
  • The split's text column comes first in the DOM and on screen at every width, so the headline and the one main button come first and focus order matches visual order (WCAG 2.4.3). RTL mirrors the split by itself: never flex-row-reverse or the order utilities for direction (D-LAY-08, D-BCP-30).
  • The art column is a product slot (the 30rem card stack of oait and Global ID, a phone mock-up, an illustration) at its own cap, at most 480px; everything else in the split is shared (D-LAY-08, D-LAY-19, D-CSN-35).
  • Below lg the filter column folds behind an outlined "Filters" button that opens a full-height bottom sheet, and the aside follows the title block while the sticky action bar carries its primary (see Page layouts) (D-LAY-14, D-BCP-24, D-CSN-50).

Rhythm

Page and component recipes

Thing Recipe (D-LAY-10, D-LAY-11, D-ARC-25) px: compact / sm / lg
Landing page frame mx-auto flex w-full max-w-page flex-col gap-section px-gutter pb-section sm:px-gutter-medium lg:gap-section-expanded lg:pb-section-expanded; sections carry no vertical padding of their own gaps 80 / 80 / 112
Full-bleed tinted band py-section lg:py-section-expanded, spanning the window outside the page frame, with its own page frame inside 80 / 80 / 112
Section heading block max-w-reading: the eyebrow 12px (mb-3) above the title, title to lead 16px (mt-4 on the lead, the stack step; a gap-stack column would add to the eyebrow's 12px), the content after it at mt-section-head (canonical §10.27) 12 and 16 inside, 48 to content
Hero text column flex flex-col gap-6; CTA row mt-2 flex flex-col gap-3 sm:flex-row (buttons full width below sm) 24; 32 above the buttons
Card padding p-card sm:p-card-medium in every density; a card that holds a list lets the rows pad themselves 20 / 24 / 24
Dialog, bottom sheet p-card-medium; sheets 16px at the top under the handle 24
Hero panel rounded-hero px-5 sm:px-10 lg:px-16 py-12 lg:py-20, inside the gutter inline 20 / 40 / 64; block 48 / 48 / 80
Feature panel px-5 sm:px-10 lg:px-16 py-10 lg:py-16 inline 20 / 40 / 64; block 40 / 40 / 64
Auth card w-full max-w-form px-5 sm:px-10 py-10 gap-stack-loose (C-8) inline 20 / 40 / 40; block 40
Auth frame panel mx-[calc(0.5rem+env(safe-area-inset-left))] sm:mx-4 px-2 py-8 sm:px-4 sm:py-14; the page scrolls as a document —
List row px-row-inset sm:ps-row-inset-medium py-2 (start 24 from sm, end 16; three-line rows py-3) start 16 / 24 / 24
Menu and drawer rows px-row-inset 16
Form flex flex-col gap-fields; fieldsets gap-stack-group 20; 32
App page (inside the shell's <main>) mx-auto flex w-full max-w-page flex-col gap-stack-loose md:gap-stack-group (max-w-wide in consoles) 24 below md, 32 from md

Reference CSS (base.css):

  • .oa-page is the landing page frame. It may sit on <main> only when the page has no full-bleed band; with bands, <main> is the full-bleed parent of .oa-page frames and .oa-band siblings, and a frame that follows a band starts one section below it (.oa-band + .oa-page).
  • .oa-band is the full-bleed tinted band, which pads itself and the side insets and holds an .oa-container.
  • .oa-stack (16px) with --tight (8), --loose (24), and --group (32) is the stack ladder; .oa-stack--fields (20px, --space-fields) is the form recipe flex flex-col gap-fields.
  • .oa-cluster is a wrapping row of buttons or inline items 12px apart (chip rows use .oa-chip-group).

The stack ladder

Token px Use (D-LAY-10)
stack-tight 8 Inside a text group: a title and its supporting text, a label and its value, bulleted-list items
stack 16 Between groups inside a card or section: title → lead, paragraphs, a card's text and its note (a section header's eyebrow sits 12px above its title)
stack-loose 24 Between blocks of a container (card, dialog, sheet, auth card), above a container's action row, between blocks of an app page below md
stack-group 32 Between groups of an app page from md, an app section's heading and its content, the fieldsets of a long form

Rules:

  • Landing sections are spaced by the frame's gap, never by their own padding, so padding never doubles (D-LAY-10).
  • Panels, the inverse band included, sit inside the page gutter on rounded-hero; the full-bleed tinted band is the one surface that spans the window. At most one inverse band and one primary panel per page (D-LAY-11, D-CSN-08).
  • Card padding never changes with density: 20 → 24px everywhere (D-LAY-11, D-LAY-18).
  • App sections keep 32px between their heading and content (stack-group); marketing sections use 48px (section-head) (D-LAY-10).

Targets and control heights

Token px Tailwind Use (D-LAY-12, D-ARC-04, D-ARC-05)
--size-touch-target 48 min-h-12 min-w-12 The least hit area of every control on every product
--size-button-sm 40 h-10 Small button, its hit area extended to 48px
--size-button-md 48 h-12 Default button, icon buttons, segmented buttons, medium chips
--size-button-lg 56 h-14, or min-h-14 when the label may wrap The one main action of a screen, hero CTAs, full-width actions on phones
--size-chip-sm 32 h-8 Small chips in dense toolbars and admin filter rows, medium status chips; interactive ones extend to 48px
--size-field 56 h-14 Text fields and selects (16px text, so phones do not zoom); text areas start at 112px (min-h-28)

Rules:

  • 48×48px is the floor for every control; WCAG 2.5.8 asks for 24. The 44px floor of oait, Games, and Tamakkan retires (D-LAY-12).
  • Links inside running text are the only exemption, and they get no minimum height, so line spacing stays even (D-LAY-12).
  • A visual smaller than 48px extends its hit area with an absolute ::after on the padding box. The 1px border shrinks that box, so the extender counts it (D-ARC-05):
Visual Extender Hit area
40px button relative after:absolute after:inset-x-0 after:-inset-y-[5px] 48px
32px chip relative after:absolute after:inset-x-0 after:-inset-y-[9px] 48px
20px checkbox or radio inside a <label> row at least 48px tall the whole row
  • after:-inset-y-1 gives only 46px: it ignores the border (D-ARC-05).
  • Rows of extended controls keep 8px (40px buttons) or 16px (32px chips) between them, so the extended hit areas never overlap (D-ARC-05).
  • When ::after is taken (a stretched card link), extend through the padding box instead (D-ARC-05).
  • Text-bearing controls that may wrap take a minimum height (min-h-12, min-h-14), never a fixed one, so Arabic's taller lines and French's longer labels can grow them (D-LAY-12).

Icon, tile, avatar, and mark sizes

Each family is one ladder; never an in-between size (D-LAY-13, D-ARC-22, D-ARC-23).

Icons px Tailwind Use
--size-icon-xs 16 size-4 Beside 12–13px text: field error and helper icons, dense status marks
--size-icon-sm 18 size-4.5 Chips and 40px buttons
--size-icon-md 20 size-5 48px and 56px buttons, menu rows, field adornments, inline with 14–16px text
--size-icon-lg 24 size-6 The default: icon buttons, navigation, app bars, list leading icons
--size-icon-xl 28 size-7 Inside 56px tiles and step discs
--size-icon-2xl 32 size-8 The 64px empty-state disc
--size-icon-3xl 40 size-10 The 80px problem-state disc; station and stage controls
--size-icon-4xl 64 size-16 Bare icons of full-page states (404, offline, error)
Tiles and discs px Tailwind Holds
--size-tile-sm 40 size-10 icon-md: a list row's leading tile, a status disc
--size-tile-md 48 size-12 icon-lg: company or app logo tile, platform picker tile
--size-tile-lg 56 size-14 icon-xl: feature card tile, step disc
--size-tile-xl 64 size-16 icon-2xl: the empty-state disc
--size-tile-2xl 80 size-20 icon-3xl: the tonal disc of a full-page problem state
Avatars px Tailwind Use
--size-avatar-sm 40 size-10 List rows, tables, the header
--size-avatar-md 56 size-14 Card headers, account summary
--size-avatar-lg 96 size-24 Profile page, person record (C-3)
Marks px Tailwind Use
--size-mark-xs 24 size-6 Footer platform lists and sign-offs; the smallest mark on screen
--size-mark-sm 32 size-8 The S lock-up (headers below 640px); marks in 48px picker tiles
--size-mark-md 40 size-10 The M lock-up (headers from 640px, footers); app tiles
--size-mark-lg 64 size-16 Status and install pages
--size-mark-xl 88 size-22 The install hero
--size-mark-stage 76 size-19 Product note (Games): the stage lock-up

Rules:

  • A tile or disc holds an icon about half its size (D-LAY-13, D-ARC-23).
  • The 56px button takes the 20px icon, like the 48px one (D-ARC-22).
  • Icons themselves are covered in Iconography; tile corners in Shape.

Chrome and shells

Chrome sizes

Token px Tailwind Rule (D-LAY-14, D-ARC-24)
--size-header 72 h-18 Every site header at every width (any hairline inside), and the app bar from md; plus the top inset
--size-header-compact 64 h-16 The app bar below md, only in shells that have a bottom bar
--size-nav-bar 80 — The bottom bar below md: 12 top, a 32px indicator, 4, a 16px label, 16 bottom, plus the bottom inset (85px in Arabic, see RTL and languages)
--size-nav-rail 96 w-24 The navigation rail from md
--size-nav-drawer 272 md:grid-cols-[var(--size-nav-drawer)_minmax(0,1fr)] The console drawer from md; also the filter column
--size-side-pane 320 lg:grid-cols-[minmax(0,1fr)_var(--size-side-pane)] A supporting pane beside the content from lg: action aside, summary, guide
--size-list-row 56 min-h-14 One-line list rows and drawer items
--size-list-row-two-line 72 min-h-18 Two-line list rows
--size-list-row-three-line 88 min-h-22 Three-line list rows
--size-menu-item 48 min-h-12 Menu and dropdown rows; one-line table rows in compact density
--size-table-header 56 h-14 The header row of a data table
--size-table-row 64 h-16 Table rows with an avatar or two lines
Part Geometry (D-LAY-09, D-LAY-14, D-CSN-12, D-CSN-13)
Site header 72px at every width (min-h-18 on its inner row), inside the page frame, plus the top inset
App bar 64px below md in shells with a bottom bar (the member app) and 72px from md; 72px at every width in shells without one (the console); start padding 16 / 24px, end padding 4 / 16px (the trailing icon button's own inset completes the gutter); a grid row that never scrolls away
Bottom bar 80px plus the bottom inset: pt-3, pb-[calc(1rem+env(safe-area-inset-bottom))], sides calc(0.5rem + inset); 2–5 destinations share the width; indicator 64×32
Rail 96px (w-24), pt-3 pb-6; destinations 80px wide and at least 56px tall, 12px apart; indicator 56×32
Drawer 272px, padding 12px; items 56px (h-14) with 16px inline padding; group disclosures 48px
Console "Menu" row (below md) 48px tall, full width, a bottom hairline; it opens the drawer as a modal side sheet from the inline start
Modal side sheet w-[85vw] max-w-side-sheet, full height, layer modal, with the scrim
Side pane 320px from lg; sticky top-24 (96px) when the page has a sticky header

Which navigation each surface uses (D-CSN-13):

Surface Below md (768px) From md
Member app, 2–5 destinations Navigation bar Navigation rail
Console, more than five destinations or grouped "Menu" row opening a modal side sheet Navigation drawer
Marketing site Site header and its menu side sheet Site header; its links show from lg, the menu sheet until then
Kiosk, stage, scanner, station No navigation chrome; leave by a labeled button The same

The member app shell

Global ID's AppShell is the family's shell (D-LAY-09):

<a class="oa-skip-link" href="#main">Skip to content</a>
<div class="grid h-dvh grid-cols-[minmax(0,1fr)] grid-rows-[auto_minmax(0,1fr)_auto] md:grid-cols-[auto_minmax(0,1fr)] md:grid-rows-[auto_minmax(0,1fr)] md:pr-[env(safe-area-inset-right)] md:pl-[env(safe-area-inset-left)]">
  <header class="bg-surface pt-[env(safe-area-inset-top)] pr-[env(safe-area-inset-right)] pl-[env(safe-area-inset-left)] md:col-span-2 md:px-0">…top app bar, 64px (72px from md)…</header>
  <nav aria-label="Global ID" class="hidden md:flex">…navigation rail…</nav>
  <main id="main" tabindex="-1" class="min-h-0 overflow-y-auto overscroll-contain pt-1 pr-[calc(1rem+env(safe-area-inset-right))] pb-6 pl-[calc(1rem+env(safe-area-inset-left))] md:px-6 md:pt-2 md:pb-12">
    <div class="mx-auto flex w-full max-w-page flex-col gap-stack-loose md:gap-stack-group">…the page…</div>
    …the footer row: the privacy link, in flow…
  </main>
  <nav aria-label="Global ID app" class="md:hidden">…navigation bar…</nav>
</div>
Region Below md From md
Grid one column; rows auto / minmax(0,1fr) / auto columns auto (the rail) / minmax(0,1fr); rows auto / minmax(0,1fr); the grid pads the side insets
Header the app bar, 64px plus the top inset; it pads the side insets itself 72px, spanning both columns; md:px-0, as the grid now pads the sides
Navigation the bottom bar, 80px plus the bottom inset: the last grid row, never position: fixed, hidden while the on-screen keyboard is open the 96px rail
Main the only scroller (overscroll-contain); padding 4 top, 24 bottom, calc(16px + inset) inline padding 8 top, 48 bottom, 24 inline; the side insets move to the shell grid
Content full width capped at max-w-page
Footer one in-flow row at the end of <main> (the privacy link), never pinned the same

Plain CSS (Games, Tamakkan) writes the same grid: display: grid; height: 100dvh; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;, then from 48rem grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); with padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right) on the grid. The main region is min-height: 0; overflow-y: auto; overscroll-behavior: contain. Reference CSS: .oa-app-shell--rail for the member app and .oa-app-shell--drawer for a console, with __main, __content, __nav, __bar, and __menu; the member shell's app bar is .oa-top-app-bar--compact (64px below md), every other app bar the plain .oa-top-app-bar (72px) (top app bar, navigation bar, navigation rail, navigation drawer).

Why grid rows: a fixed bar sits where the browser puts the bottom of the window, which moves with iOS's address bar and keyboard; a grid row ends where the grid ends (D-LAY-09). The document never scrolls inside a shell, so the address bar stays put.

The console shell

The same grid with a drawer column and no bottom bar (D-LAY-09, D-CSN-13). The bar and the drawer take the grade of the site header, surface-container, and the page is the lighter sheet with a card corner where it meets them (D-CSN-58):

<a class="oa-skip-link" href="#main">Skip to content</a>
<div class="grid h-dvh grid-cols-[minmax(0,1fr)] grid-rows-[auto_auto_minmax(0,1fr)] md:grid-cols-[var(--size-nav-drawer)_minmax(0,1fr)] md:grid-rows-[auto_minmax(0,1fr)] bg-surface-container md:pr-[env(safe-area-inset-right)] md:pl-[env(safe-area-inset-left)]">
  <header class="bg-surface-container pt-[env(safe-area-inset-top)] pr-[env(safe-area-inset-right)] pl-[env(safe-area-inset-left)] md:col-span-2 md:px-0">…top app bar, 72px, with the "Admin console" chip…</header>
  <div class="md:overflow-y-auto">
    <button type="button" aria-expanded="false" aria-controls="console-menu" class="relative isolate flex min-h-12 w-full items-center gap-3 border border-transparent border-b-outline-variant bg-surface pr-[calc(1rem+env(safe-area-inset-right))] pl-[calc(1rem+env(safe-area-inset-left))] text-start text-label-md text-on-surface-variant before:absolute before:-inset-px before:-z-1 before:bg-current before:opacity-0 before:transition-opacity before:duration-short-3 hover:before:opacity-8 focus-visible:-outline-offset-4 active:before:opacity-12 active:before:duration-0 md:hidden">…menu icon, "Menu"…</button>
    <nav aria-label="Admin console" class="hidden md:flex">…navigation drawer…</nav>
  </div>
  <main id="main" tabindex="-1" class="min-h-0 overflow-y-auto overscroll-contain bg-surface pt-6 pr-[calc(1rem+env(safe-area-inset-right))] pb-[calc(1.5rem+env(safe-area-inset-bottom))] pl-[calc(1rem+env(safe-area-inset-left))] md:rounded-ss-card md:px-6 md:pb-12">
    <div class="mx-auto flex w-full max-w-wide flex-col gap-stack-loose md:gap-stack-group">…the page…</div>
    …the footer row: the privacy link, in flow…
  </main>
</div>
  • Below md the second row is the 48px "Menu" row (a <button>, not part of the nav); it opens the drawer as a modal side sheet from the inline start, on the modal layer with the scrim, and the sheet holds its own nav aria-label="Admin console" (D-CSN-13, ID-2.29). The full row and drawer recipes are on Navigation drawer.
  • From md the drawer is the first column (272px), scrolling on its own, with "Overview" first, 56px items and grouped disclosures, ending with an outlined "Back to my Global ID" button (D-CSN-13, D-CSN-58).
  • Tones (D-CSN-58): the shell, the bar, and the drawer are surface-container; <main> is surface with rounded-ss-card from md and 24px above its first line; the "Menu" row stays surface. The reference class .oa-app-shell--drawer does all of it.
  • The page never scrolls, so <html> takes [scrollbar-gutter:auto] (the reference CSS does it when <body> holds the shell, D-LAY-21).
  • The console has no bottom bar, so its app bar is 72px at every width: --size-header-compact belongs only to shells with a bottom bar (D-LAY-14).
  • The privacy footer is an in-flow row at the end of <main>, never a pinned grid row (D-CSN-15, ID-2.29).
  • With no bottom bar, <main> is the row that meets the bottom of the screen below md, so its bottom padding adds the inset: pb-[calc(1.5rem+env(safe-area-inset-bottom))]. Global ID's pinned footer carried that inset; as the footer moves into <main>, the inset moves with it, by the calc(own padding + inset) rule of Safe areas (D-LAY-17, ID-2.29).

The site header and document pages

Public and marketing pages scroll as documents under a sticky header (D-LAY-15, D-CSN-09):

<html lang="en" dir="ltr" class="scroll-pt-[calc(var(--size-scroll-offset)+env(safe-area-inset-top))] short:scroll-pt-0">
…head, with the viewport meta of Safe areas…
<body class="flex min-h-dvh flex-col bg-surface text-on-surface">
  <a class="oa-skip-link" href="#main">Skip to content</a>
  <header class="sticky top-0 z-30 short:static bg-surface/80 backdrop-blur-xl pt-[env(safe-area-inset-top)] pr-[env(safe-area-inset-right)] pl-[env(safe-area-inset-left)] forced-colors:bg-[Canvas] [@media(prefers-reduced-transparency:reduce)]:bg-surface supports-[not(backdrop-filter:blur(1px))]:bg-surface">
    <div class="mx-auto flex min-h-18 w-full max-w-page items-center gap-3 px-gutter sm:px-gutter-medium">…lock-up, navigation, actions…</div>
  </header>
  <main id="main" tabindex="-1" class="flex-1 pr-[env(safe-area-inset-right)] pl-[env(safe-area-inset-left)]">
    <div class="mx-auto flex w-full max-w-page flex-col gap-section px-gutter pb-section sm:px-gutter-medium lg:gap-section-expanded lg:pb-section-expanded">…sections…</div>
  </main>
  <footer class="border-t border-outline-variant pr-[env(safe-area-inset-right)] pl-[env(safe-area-inset-left)]">…zones; the last, the legal bar, pads its 24px plus the bottom inset…</footer>
</body>
</html>
  • The header is 72px plus the top inset, glass (bg-surface/80 backdrop-blur-xl, opaque surface under reduced transparency, forced colors, and without backdrop-filter), with no edge and no shadow. Its inner row is the page frame, at least 72px tall (min-h-18) so that zoomed text can grow it (Site header, Elevation) (D-CSN-09, D-ARC-10, D-SEM-12).
  • <main> is the full-bleed parent that carries the side insets, and the landing frame sits inside it. A full-bleed tinted band is a sibling of the frame inside <main>, padded py-section lg:py-section-expanded, with its own page frame inside; a frame that follows a band adds the same space on top (pt-section lg:pt-section-expanded; .oa-band + .oa-page in the reference CSS), so the rhythm stays 80 / 112px. Canonical §4.5 writes the landing classes on <main> itself, which works only on a page with no full-bleed band: a product that does so puts the side insets on the full-bleed parent around it and keeps its bands inside the gutter as panels. The geometry is the same (D-LAY-04, D-LAY-10, D-LAY-17).
  • html { scroll-padding-top: calc(var(--size-scroll-offset) + env(safe-area-inset-top)) } (96px plus the top inset in standalone apps; the class above on <html>) keeps anchors and focused fields clear of the sticky header; short:scroll-pt-0 drops it when the header turns static (see Keyboard, focus, and scrolling).
  • The footer pads the side insets; its last row, the legal bar, pads its own 24px plus the bottom inset, pb-[calc(1.5rem+env(safe-area-inset-bottom))] (Footer) (D-CSN-15, D-LAY-17).
  • App shells never use this header: their header is a grid row, never sticky or fixed (D-LAY-15).

Layers

z-index comes from this ladder only (D-LAY-16, D-ARC-26):

Token z Tailwind v4 Holds
--z-behind −1 -z-1, inside an isolate parent Decoration behind content inside an isolated parent: soft shapes, glows, orbit art
--z-raised 10 z-10 A control over a stretched card link, a control over card art
--z-sticky 20 z-20 Sticky parts of the content: asides, table headers, the sticky action bar
--z-header 30 z-30 Sticky or fixed page chrome: the site header, an app bar, a fixed bottom bar, a FAB
--z-dropdown 40 z-40 Menus, popovers, listboxes, non-modal panels over the page
--z-modal 50 z-50 The scrim with a dialog, bottom sheet, or modal side sheet; blocking full-screen overlays (a station's busy and result screens)
--z-snackbar 60 z-60 Snackbars and toasts
--z-tooltip 70 z-70 Tooltips
--z-skip-link 80 z-80 The skip link while it has focus

Tailwind v3 products read the same ladder from the preset's zIndex keys (behind, raised, sticky, header, dropdown, modal, snackbar, tooltip, skip-link), so the v3 class is z- plus the key: z-header is 30.

Rules:

  • Plain CSS writes z-index: var(--z-header); Tailwind v4 may write z-(--z-header) to show the name. Both equal z-30 (D-LAY-16).
  • A component that stacks its own children (card stacks, decorative shapes, art) sets isolate (isolation: isolate) and uses local values 1–3, or -z-1; the tokens are for page-level layers only (D-LAY-16).
  • Nothing goes above 80. Sonner's 999999999 and every 99, 100, 200, 1000, or 2000 move onto the ladder (D-LAY-16).
  • The site header (30) stays above sticky table headers and asides (20) (D-LAY-16).
  • Snackbars (60) sit above modals (50), so the feedback after a dialog closes is never hidden; one that appears while a modal is open is visible but inert, as the modal makes the page inert (D-LAY-16).
  • The console drawer below md is a modal side sheet, so it lives on modal with the scrim, as the --z-dropdown token note says. Canonical §4.9 still lists "the folded admin drawer" on dropdown: that is today's non-modal Global ID panel, which becomes the side sheet (D-CSN-13, ID-2.29).
  • The tooltip layer (70) is a web convention not yet observed in the family; confirm it when the first tooltip ships (D-LAY-16).

Safe areas

Every product sets <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">, so the page reaches under notches and home indicators, and chrome pads itself where it meets the screen edge (D-LAY-17).

Element Rule (D-LAY-17)
Full-bleed parents: header, main, footer, the shell grid from md pl-[env(safe-area-inset-left)] pr-[env(safe-area-inset-right)]. Physical, even in RTL: the insets are physical
Header pt-[env(safe-area-inset-top)] on top of its 72px
App shell <main> below md pl-[calc(1rem+env(safe-area-inset-left))] pr-[calc(1rem+env(safe-area-inset-right))]; in a shell without a bottom bar (the console) also pb-[calc(1.5rem+env(safe-area-inset-bottom))]
Bottom bar pb-[calc(1rem+env(safe-area-inset-bottom))], sides calc(0.5rem + inset)
Bottom sheet its own 24px plus the inset at the bottom, pb-[calc(1.5rem+env(safe-area-inset-bottom))]; a sheet whose inner parts carry the 24px (shadcn's) pads pb-[env(safe-area-inset-bottom)]
Sticky action bar pt-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))]
Snackbar host bottom-[calc(6rem+env(safe-area-inset-bottom))] above a bottom bar, otherwise bottom-[calc(1rem+env(safe-area-inset-bottom))]; from md md:bottom-[calc(1.5rem+env(safe-area-inset-bottom))]
Document footer its last row, the legal bar, pb-[calc(1.5rem+env(safe-area-inset-bottom))]

Rules:

  • Add the inset to the element's own padding, calc(own padding + inset), never max(padding, inset). WebKit's article that introduced the insets combines them with max(), the default padding or the inset, whichever is greater (Designing websites for iPhone X). The family adds instead, so a bar keeps its full padding above the home indicator and beside the notch; the sum is never smaller than max() would give (D-LAY-17, D-APP-58).
  • An inset can be 0 (an iPhone's side insets in portrait), so it never stands in for a gutter: the gutter stays, and the inset comes on top (same WebKit article).
  • In Tailwind recipes these paddings are the only physical left and right in layout. Comment them in plain CSS so nobody "fixes" them to logical properties (D-LAY-17, D-BCP-30).
  • On iPhones in landscape both side insets are equal, so content stays centered (D-LAY-17).

Safe-area variables

The reference CSS never reads env() itself. base.css defines the insets once, and every rule that pads or offsets by an inset reads these custom properties (D-APP-58):

Property Value Use
--oa-safe-top, --oa-safe-bottom env(safe-area-inset-top, 0px), env(safe-area-inset-bottom, 0px) headers and app bars; bottom bars, sheets, the legal bar, the snackbar host
--oa-safe-left, --oa-safe-right env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px) the physical sources of the next two; a shell overrides these
--oa-safe-start, --oa-safe-end the left and right insets in left-to-right, swapped under dir="rtl" logical paddings: padding-inline: var(--oa-safe-start) var(--oa-safe-end) pads the same sides as the physical recipe above
  • Why an indirection: inside a hybrid shell the web view does not always report the insets. Android System WebView before version 140 gives wrong env(safe-area-inset-*) values, and Capacitor 8's System Bars plugin injects correct ones as --safe-area-inset-* (Capacitor System Bars); a host app that consumes the window insets sends the page none at all (Android WebView insets). A shell then sets the four physical properties on :root, after oait-ui.css or in a style attribute on <html>, and start and end follow (D-APP-58, D-APP-59):

    :root[data-shell] {
      --oa-safe-top: var(--safe-area-inset-top, 0px);
      --oa-safe-bottom: var(--safe-area-inset-bottom, 0px);
      --oa-safe-left: var(--safe-area-inset-left, 0px);
      --oa-safe-right: var(--safe-area-inset-right, 0px);
    }
  • The base rules have zero specificity (:where()), so any later rule wins.

  • --oa-safe-start and --oa-safe-end follow the dir attribute of the nearest element that has one. A region whose direction comes from CSS alone, or from dir="auto", keeps its parent's pair.

  • Tailwind products that run inside a hybrid shell write the same properties in their recipes, for example pt-(--oa-safe-top) and pb-[calc(1rem+var(--oa-safe-bottom))]; on the open web the env() recipes above give the same result.

Viewport height

Use the dynamic viewport unit dvh only. Never vh, 100vh, -webkit-fill-available, or Tailwind's h-screen and min-h-screen (which are 100vh): on phones vh ignores the browser's moving bars (D-LAY-17).

Element Recipe (D-LAY-17)
App shell grid h-dvh …; only <main> scrolls, with overscroll-contain
Document frame flex min-h-dvh flex-col, with <main class="flex-1"> so a short page keeps its footer at the bottom
Dialog max-h-[calc(100dvh-2rem)] overflow-y-auto; the body scrolls between a fixed header and actions
Bottom sheet max-h-[90dvh] overflow-y-auto

Product note (Games): the projector stage is a product slot outside the page system; its fixed 1920×1080 artboard scales to the window as the large-display stage pattern describes (D-LAY-19).

Keyboard, focus, and scrolling

Situation Rule (D-LAY-15, D-LAY-17)
Sticky site header html { scroll-padding-top: calc(var(--size-scroll-offset) + env(safe-area-inset-top)) } (96px plus the top inset in standalone apps; Tailwind scroll-pt-[calc(var(--size-scroll-offset)+env(safe-area-inset-top))] on <html>, as in the document page), so focus and anchor targets are never hidden under the header (WCAG 2.4.11)
Anchor targets covered by the scroll padding above; never also [id] { scroll-margin-top }, which adds up to 192px (measured in Chromium)
Sticky bottom bar html { scroll-padding-bottom: calc(<bar height> + 16px) } while the bar shows. The sticky action bar is about 81px (12 + 56 + 12 + the 1px edge), so --size-scroll-offset plus the bottom inset covers it: max-lg:scroll-pb-[calc(var(--size-scroll-offset)+env(safe-area-inset-bottom))] on <html>
Short viewports short:static on sticky headers and sticky bars, at (max-height: 30rem); the scroll padding goes with them (short:scroll-pt-0, short:scroll-pb-0)
On-screen keyboard The bottom bar hides (hidden) while visualViewport.height * visualViewport.scale < 0.75 * innerHeight (Global ID's test)
A keyboard that overlays the page Where the keyboard covers the page instead of resizing it (iOS Safari, WKWebView, an installed iOS web app, Capacitor on iOS with resize mode none), a script sets --oa-keyboard-inset on <html> to the height the keyboard covers; bottom sheets and the responsive modal then sit on top of the keyboard and shrink by it (D-APP-36, D-APP-59). The property is 0 by default, so nothing changes where no script sets it
Forms on phones In the scrolling document or a scrolling sheet; never fields in a fixed-height box that does not scroll
Sticky aside sticky top-24 (96px) under the sticky header, on the sticky layer, with self-start so the grid does not stretch it

Rules:

  • The skip link ("Skip to content" / "الانتقال إلى المحتوى" / "Aller au contenu") is the first focusable element and targets <main id="main" tabindex="-1">; while focused it is fixed top-3 start-4 z-80, plus the top and start insets, so it never sits under a notch (C-2, D-ARC-26, D-LAY-17).

  • The keyboard inset comes from the visual viewport. This script is the reference; check it on a device, because how each engine reports the visual viewport under a keyboard was not measured in this package:

    const vv = window.visualViewport;
    const root = document.documentElement;
    const update = () => {
      const covered = root.clientHeight - vv.height - vv.offsetTop; // the layout viewport below the visible part
      root.style.setProperty('--oa-keyboard-inset', `${Math.max(0, Math.round(covered))}px`);
    };
    vv.addEventListener('resize', update);
    vv.addEventListener('scroll', update);
  • The keyboard shrinks the visual viewport, not the layout viewport (VisualViewport); from Chrome 108, Chrome on Android does the same as Safari (viewport resize behavior), and resizes the page only when the viewport meta asks for it with interactive-widget=resizes-content (viewport meta). The family does not rely on that value: released Safari does not support it, and Android System WebView ignores the overlay modes (D-APP-59).

  • DOM order equals visual order: the text column, the h1 of a listing, and the main action come first in the DOM (D-LAY-08).

  • The 72px sticky header costs about 8.5% of an 844px phone screen; the short variant gives the room back in landscape (D-LAY-15).

Scrollbars

One look and one place on every product (D-LAY-20; canonical §4.10). The base layer sets it; products add nothing.

:root {
  scrollbar-color: var(--color-outline) transparent; /* the thumb on a clear track */
  scrollbar-gutter: stable;                          /* the page keeps the bar's place */
}
:where(:not(html)) {
  scrollbar-width: thin;                             /* scroll regions inside the page */
}
  • Style. The thumb is outline on a clear track, so the bar takes the surface it sits on, in both themes. outline is 3.65:1 or more on every surface.
  • Place. The page scrollbar sits at the inline end of the window and keeps its gutter whether or not the page scrolls, so nothing shifts from page to page. A scroll region inside the page (a menu, a sheet, a table) draws its bar at its own inline end, in the thin form.
  • Left to the platform. The shape, the arrows, and overlay behavior: on phones and on macOS the bar overlays the content and fades, and it must keep doing so.
  • Never. ::-webkit-scrollbar styling (it forces always-visible bars where they overlay), a hidden scrollbar on a region that scrolls, a custom-drawn bar, a page that scrolls sideways, or two page scrollbars: in an app shell only main scrolls.
  • App shells give the gutter up (D-LAY-21). A shell page never scrolls as a page, so the kept gutter would show as an empty strip beside the top app bar. The reference CSS sets scrollbar-gutter: auto when <body> holds .oa-app-shell; a product that nests the shell deeper, or builds it with Tailwind, puts [scrollbar-gutter:auto] on <html> for those pages.

Density

Comfortable is the default for every consumer surface and every phone layout. Compact is for consoles and organizer tools, from md only (D-LAY-18).

Element Comfortable (default) Compact (consoles, from md)
Body text in data 16px 14px
List rows 56 / 72px 48 / 64px
Table header / rows 56 / 64px 56 / 64px (one line: 48px)
Table cells — 12px inline, 8px block (px-3 py-2)
Menus 48px 48px
Chips 32px, 48px hit area 32px, 48px hit area
Card padding 20 / 24px 20 / 24px (unchanged)
Targets 48px 48px
Gutters, containers, stacks unchanged unchanged

Rules:

  • Density never changes the spacing scale, the 48px targets, or the gutters, so a console component still works on a phone (D-LAY-18).
  • A console on a phone uses comfortable density, with its drawer behind "Menu" (D-LAY-18).
  • Tables keep their minimum width and scroll sideways inside their labeled region (overflow-x-auto) (D-LAY-18, D-CSN-34).

RTL and languages

  • Logical properties throughout (ps-6, pe-4, ms-auto, start-4, end-0, text-start, rounded-ss-box, border-s); grids and flex rows mirror by themselves. The only physical properties are the safe-area paddings (D-LAY-17, D-BCP-30).
  • Decorative shapes are placed with start and end utilities (start-0, end-0), never left and right (D-BCP-30, D-SEM-05).
  • Never mirror with flex-row-reverse or the order utilities; the split keeps the text column first in the DOM, and in Arabic it sits at the right, the inline start (D-LAY-08, D-BCP-30).
  • Text-bearing controls whose label may wrap take a minimum height (min-h-12, min-h-14), never a fixed one, and no control gets a fixed width. In Global Jobs, Arabic's 1.7–1.8 line heights lift 48px controls to 50–54px (D-LAY-12, D-ARC-04).
  • French runs about 26% longer than English overall and up to 32% for short labels (canonical §3.7, D-TYP-15). Only the app bar's context chip may truncate: it gets min-w-0 truncate inside a flexible row, so it gives way before the lock-up (canonical §10.15, D-CSN-13); every other chip keeps its words (§10.9). Truncation is only the safety net: the "Admin console" chip must fit the app bar at 360px in French. Global ID's "Console d’administration" truncates there today, so the shorter "Administration" is proposed (native review); in Arabic it reads "لوحة الإدارة".
  • Chrome grows with Arabic line heights: the bottom bar's 12px label takes a 21px line in Arabic, so the bar measures 85px plus the inset (measured in Chromium). Build bars and rows from padding and content with a minimum height, never a fixed height (D-LAY-12, D-TYP-14).
  • Navigation labels from Global ID's shell, for length checks: Home / الرئيسية / Accueil, My ID / هويتي / Mon ID, Vault / الخزنة / Coffre-fort, Me / أنا / Moi, Profile / ملفي الشخصي / Profil, Apps / التطبيقات / Applications, Security / الأمان / Sécurité, Menu / القائمة / Menu.
  • Test every layout at 320px and 390px in English, Arabic, and French, plus a 360px French screenshot; nothing scrolls sideways at 320px (WCAG 1.4.10) (D-LAY-02, D-BCP-25).

See Languages and RTL for direction, isolation, and formats.

Page layouts

Annotated layouts of the five frames that every page pattern builds on. Numbers are px; RTL mirrors each one, so "inline start" is the left in English and the right in Arabic.

Every frame follows the rules for all templates (canonical §11, D-BCP-24):

  • The skip link comes first; one h1, first in <main id="main" tabindex="-1">; the landmarks are <header>, labeled <nav> elements, <main>, and <footer>.
  • One filled 56px primary per screen; text before art on phones; the lock-up name always visible.
  • Navigation never disappears: a header with links gets the 48px menu button below 1024px (D-CSN-12).
  • Web pages get the sticky glass header and the 96px scroll padding; app shells keep the header as a grid row (D-LAY-15).
  • The footer carries the endorsement line and the language switcher; lang and dir sit on <html>; the status region is mounted at load; no framework-default error page ships.

Marketing page

Template 1 (landing page) at 1440px. One edge: the lock-up and every section start at x = 104 (the dotted guides), and the header's last action ends at x = 1336; the hero text starts at x = 168 (80 + 24 + the panel's 64).

       |<--------------- content 1232, x = 104 to 1336 ---------------->|
+------------------------------------------------------------------------------+
|      [M lock-up]         section links         Language  Sign in  [CTA]      |  header 72, sticky
+------------------------------------------------------------------------------+
|      :                                                                :      |
|      +- hero panel: rounded-hero, px 64, py 80 -----------------------+      |
|      |    text column, 1.05fr     <48>  art column, 1fr               |      |
|      |    starts at x = 168             product slot, max 480         |      |
|      |    eyebrow, h1, lead             aria-hidden art               |      |
|      |    [filled lg] [outlined lg]                                   |      |
|      +----------------------------------------------------------------+      |
|      :                              112                               :      |  section gap
|      heading block: eyebrow 12 above the title, lead 16 below; max-w-reading |
|      :                              48                                :      |  section-head
|      [      card      ]  16  [      card      ]  16  [      card      ]      |  3 columns
|      :                              112                               :      |
|      +- inverse band: rounded-hero, inside the gutter ----------------+      |
|      |    at most one per page                                        |      |
|      +----------------------------------------------------------------+      |
|      :                              112                               :      |
|      FAQ; closing statement with one primary                                 |
|      :                              112                               :      |  bottom padding
+------------------------------------------------------------------------------+
|      footer: lock-up, link groups, endorsement, language switcher            |
+------------------------------------------------------------------------------+

At 390px:

+--------------------------------------+
| [S lock-up]          [CTA]  [Menu]   |  header 72 + top inset
+--------------------------------------+
|16+--------------------------------+16|
|  | hero panel: px 20, py 48       |  |
|  | eyebrow                        |  |
|  | h1                             |  |
|  | lead                           |  |
|  | [ filled lg, full width  ]     |  |
|  | [ outlined lg, full width]     |  |
|  | 40 (split gap)                 |  |
|  | art column                     |  |
|  +--------------------------------+  |
|  :              80                :  |  section gap
|  heading block                       |
|  :              48                :  |
|  [ card                           ]  |
|  :              16                :  |
|  [ card                           ]  |
+--------------------------------------+

Member app

Template 3 (app home): the shell with a bottom bar below md and a rail from md.

Below md (390px)                        From md (1440px)
+--------------------------------+      +-----------------------------------------------+
| app bar 64 + top inset         |      | app bar 72, spans both columns                |
| [mark] Global ID   [lang] [av] |      +----------+------------------------------------+
+--------------------------------+      | rail 96  | main: the only scroller            |
| main: the only scroller        |      |          | 8 top, 48 bottom, 24 inline        |
| padding 4 top, 24 bottom,      |      | Home     | +-------------------------------+  |
| 16 + inset inline              |      | My ID    | | content, max-w-page,          |  |
|  h1 Good morning, {name}       |      | Vault    | | 32 between groups             |  |
|  the pass, its one primary     |      | Profile  | +-------------------------------+  |
|  tiles, 2 columns              |      | Security | privacy link, in flow              |
|  24 between groups             |      |          |                                    |
|  privacy link, in flow         |      +----------+------------------------------------+
+--------------------------------+
| bottom bar 80 + bottom inset   |
| Home | My ID | Vault | Me      |
+--------------------------------+

Global ID's bar lists four places (Home, My ID, Vault, and Me); on phones Profile and Security are pages of Me, which stays current while they are open. A member app keeps two to five destinations (canonical §10.15): the sixth place of Global ID's newest rail, Apps, is a product migration, moving under Home's "Your apps" or into the account menu (Navigation rail).

Console

Template 7 (admin console): the drawer shell, compact density from md.

Below md (390px)                        From md (1440px)
+--------------------------------+      +-----------------------------------------------+
| app bar 72 + top inset         |      | app bar 72: lock-up, "Admin console" chip     |
| lock-up, chip (truncates)      |      +------------+----------------------------------+
+--------------------------------+      | drawer 272 | main: padding 8 top, 48 bottom   |
| [ Menu ]   48, full width      |      | padding 12 | content, max-w-wide (1408)       |
+--------------------------------+      | Directory  |  h1, intro                       |
| main: comfortable density      |      |  People    |  filter row: chips, search       |
| 16 + inset inline              |      |  Photos    |  table region, scrolls sideways  |
|  h1, intro, filters            |      | Places and |   header 56, rows 64 or 48       |
|  table region, scrolls         |      | scans      |  pagination, bulk bar            |
|  sideways                      |      | [Back to my|                                  |
|  privacy link, in flow         |      |  Global ID]|  privacy link, in flow           |
+--------------------------------+      +------------+----------------------------------+

Below md, "Menu" opens the drawer as a modal side sheet from the inline start: w-[85vw] max-w-side-sheet, full height, the scrim, on the modal layer.

Listing with filters

Template 4 (listing with search and filters) inside the page frame at 1440px.

+-------------------------------------------------------------------------------+
| search panel (role="search"): keyword | location | [Search, lg]               |
| h1 with the count: "15 jobs in the Middle East and North Africa"              |
| applied filter chips ... Clear filters                                        |
+------------------------+------------------------------------------------------+
| filter column 272      | results: full-width cards, 24 from the column        |
| disclosure groups of   | [ job card                                         ] |
| 48px checkbox rows     | [ job card                                         ] |
| with counts            | pagination, or "Show more"                           |
+------------------------+------------------------------------------------------+

The body is grid gap-gutter-medium lg:grid-cols-[var(--size-nav-drawer)_minmax(0,1fr)]. Below lg the filter column folds behind an outlined "Filters" button (the tune icon and a count badge) under the chips; it opens a full-height bottom sheet that ends with "Show {n} results" and "Clear filters". The h1 stays before the filters in the DOM.

Detail with aside

Template 5 (detail page) inside the page frame at 1440px.

+-------------------------------------------------------------------------------+
| back link: arrow_back (mirrored) + "Back to {place}"                          |
| notices                                                                       |
+-------------------------------------------------------+-----------------------+
| title block: h1, organization + verified badge,       | action aside 320      |
| meta list with 20px icons                             | sticky top-24 (96)    |
|                                                       | [ Apply now, full  ]  |
| h2 sections: short paragraphs and lists               | reassurance line      |
| organization card                                     | facts                 |
| related cards, 2 columns                              | [Save]  [Share]       |
|                                                       | Never pay to apply    |
|                                                       | Report                |
+-------------------------------------------------------+-----------------------+

The body is grid gap-gutter-medium lg:grid-cols-[minmax(0,1fr)_var(--size-side-pane)] with three children in DOM order: the title block, the aside, then the sections. From lg the aside takes the second column across both rows, lg:sticky lg:top-24 lg:z-20 lg:col-start-2 lg:row-span-2 lg:row-start-1 lg:self-start: Global Jobs' job page today, plus lg:z-20, the sticky layer. The title block and the sections stay in the first column (lg:col-start-1). Below lg the aside follows the title block without its primary, and the sticky action bar (a one-line summary and "Apply now", filled lg) sits at the bottom of the window: sticky bottom-0 z-20 short:static, glass, a top hairline, the bottom inset. It never appears together with a navigation bar.

Tailwind defaults to avoid

tokens/tailwind.css resets only colors and fonts, so these Tailwind defaults still compile in 1.0.0. Never write them in product code; a lint rule can match this list (D-SEM-23, D-ARC-18, V-7):

  • Radius: bare rounded, rounded-xs, rounded-md, and rounded-lg (8px outside shadcn products); rounded-sm, rounded-xl, and rounded-2xl through rounded-4xl, which mean 4, 12, and 16–32px without shadcn.css and 8 and 24px with it. Write rounded-4px, rounded-12px, rounded-box, rounded-card, or rounded-hero. Unedited shadcn/ui components keep their rounded-sm … rounded-xl, which the bridge maps onto the scale.
  • Shadows: shadow, shadow-sm, shadow-md, shadow-lg, shadow-xl, shadow-2xl.
  • Easing: ease-in, ease-out.
  • Layout: max-w-prose (write max-w-measure) and the container class (write the page frame). max-w-7xl equals max-w-page: write max-w-page.
  • Viewport height: h-screen, min-h-screen (write h-dvh, min-h-dvh).
  • Animation: animate-spin, animate-pulse, animate-ping, animate-bounce (write animate-spinner and animate-skeleton).
  • Type: text-lg through text-9xl (text-3xl is the retired 30px; write the text-<style> utilities); font-thin, font-extralight, font-light, font-extrabold, font-black; tracking and leading utilities such as tracking-wide or leading-6.

shadcn/ui defaults and their family values (Jobs, and the output of v0, Lovable, and Bolt) (D-LAY-06, D-LAY-12, D-LAY-16, D-ARC-05, D-CAI-03):

shadcn default Family value
Button, size default, h-9 px-4 h-12 px-6 (48px)
Button, size sm, h-8 h-10 px-5 with the 48px extender after:-inset-y-[5px]
Button, size lg, h-10 h-14 px-7 (56px)
Button, size icon, size-9 size-12 (48px)
Input, Select trigger, h-9 h-14 px-4 text-body-lg (56px, 16px text)
Dialog content, sm:max-w-lg w-[calc(100%-2rem)] max-w-dialog p-card-medium max-h-[calc(100dvh-2rem)]
Sheet, side w-[85vw] max-w-side-sheet
Sheet, bottom max-h-[90dvh] pb-[env(safe-area-inset-bottom)]
DropdownMenu, Popover, Select content, z-50 z-40 (dropdown); menu items min-h-12
Tooltip, z-50 z-70
Dialog and Sheet overlay, z-50 z-50 (unchanged)
Sonner toaster z-index: var(--z-snackbar); width min(100vw - 2rem, 37.5rem)
container not used: mx-auto w-full max-w-page px-gutter sm:px-gutter-medium

Do and don't

Do Don't
Frame every page with mx-auto w-full max-w-page px-gutter sm:px-gutter-medium, the header included Give the header a different width from the content, or use Tailwind's container class
Step cards grid gap-grid sm:grid-cols-2 lg:grid-cols-3 Use grid-cols-[repeat(auto-fit,minmax(280px,1fr))] or change the gap at lg
Space landing sections with the frame's gap-section lg:gap-section-expanded Put py-20 on every section as well as a gap, so the space doubles
Make the bottom bar the last row of a h-dvh grid Pin a fixed bottom-0 bar over a scrolling document
Put a menu on z-40 and a dialog on z-50 Invent z-[9999] or 999999999
Extend a 40px button with after:-inset-y-[5px] Use after:-inset-y-1, which gives 46px
Cap paragraphs with max-w-measure Leave paragraphs at the full 1232px, or use max-w-prose
Size the shell with h-dvh and pad bars with calc(own padding + inset) Use 100vh, h-screen, or max(1rem, inset)
Write ps-6 pe-4 and let RTL mirror it Write physical left and right padding outside the safe areas, or mirror with flex-row-reverse
Keep the text column first in the DOM and on screen Move the art above the headline with order-first (the Global ID client-call fallback is the only exception)