Standard · Version 1.0 · 2026-11-22
Template Interface Web Design Standard
How a page is checked before it ships: on a phone, on a desktop and on paper. It sets the widths to test, the order to test them in, the bugs that keep coming back, and what a clean printout looks like. Every check is rendered and measured, never judged by reading the code.
Standards: Color · Web design
1. The rules
Eight rules. A page that keeps all of them works on any screen, for keyboard and screen reader users, and on paper.
- Three surfaces, every page. Mobile, desktop and print are each designed and each checked. A page is not finished until all three pass.
- Evidence, not reading. Render the page and measure it. Reading CSS shows structure; only rendering shows layout. Report what you measured, and say what you did not check.
- No sideways scrolling from 320px up. Content reflows down to 320 CSS pixels with no horizontal page scroll, and nothing is clipped or overlapping. WCAG 1.4.10
- Every state is designed. Hover, focus, active, disabled, selected, error, empty, loading and success all have a deliberate look. Focus is always clearly visible. WCAG 2.4.7
- Works for everyone. Landmarks, headings in order, a name on every control, status messages in a live region, full keyboard use with no traps, targets at least 24 by 24 pixels (44 for main touch controls), and motion that stops under reduced motion. WCAG 2.1.1, 2.5.8, 4.1.2
- Color follows the Color Standard. Roles instead of raw colors, and both light and dark mode pass every required pairing. Color Standard
- Honest controls. A form or button with nothing behind it says so when used. Nothing that does not work is made to look as if it does.
- Prints clean and complete. Dark ink on white, without controls or decoration, with everything a reader would want on paper and nothing that will be out of date tomorrow. Section 4 sets out how.
2. Surfaces and widths
Check at every width below, not just the widest. Each one is there because a real defect showed up at or near it.
| Surface | Check at | Why these |
|---|---|---|
| Mobile | 320px, 375px | 320 is the WCAG reflow width, and four overflow bugs once existed only at or below 375. Headless browsers clamp windows below about 500px, so set these widths through device emulation. |
| Tablet | 700px, 900px | Where most layouts change their column count, and where cards and tables first get squeezed. |
| Desktop | 1023px, 1150px, 1440px, 1920px | Either side of the common 1024 and 1200 breakpoints, a typical laptop, and a wide screen where line length and empty space give a layout away. |
| US Letter (8.5 by 11 in), fitting A4 | Print preview or a saved PDF. Do not fix the paper size in CSS: A4 is narrower (8.27 in), so a page that fits A4 fits both. |
The listed widths are samples, not a continuous range. One defect lived only between 761px and 1080px. After the fixed widths, drag the window slowly from narrow to wide and watch for anything that jumps or overflows.
3. The review method
Do these in order for every page. A fix is not finished until the page has been rendered and measured again.
- Screenshot every width in section 2, and look at every screenshot.
- Scroll the whole page at 1440px and at 375px. Most pages are taller than one screen, and the lower sections are where unfinished work hides.
- Measure overflow at each width:
document.documentElement.scrollWidthmust equalclientWidth. To find the cause, set a suspect element's width tomin-content; the one whose minimum is wider than the viewport is the culprit. - Use every control with real mouse and key events: hover, focus, active, disabled, keyboard use, and Escape closing menus and returning focus. Scroll a control into view before clicking it.
- Read the console. Zero errors from the page, using a fresh browser profile so extensions do not add noise.
- Measure contrast for every text and background pair and every meaningful border, in light and dark mode, against the Color Standard's required pairings.
- Print to PDF and read every page, following section 4.
- Fix, then repeat the steps the fix touched. Record the root cause by name (for example, "bare
1frtrack in the tablet override"), not "fixed mobile bugs".
4. Print
People print menus, recipes, documentation, receipts, tickets, hours and directions. The printout is a reading copy of the page: decide what is worth having on paper, and leave out everything else.
Leave out
- Site and page navigation, theme switches and cookie banners.
- Buttons, filters, tabs, forms and anything else that needs a click.
- Live state that will go stale: "open now", "today", countdowns, stock levels.
- Decorative illustrations, hero art and background effects.
- Panels about the page rather than part of it.
Keep, and adjust
- All the content, including what is hidden behind tabs, accordions or "show more" on screen.
- Dark text on white, whatever mode the screen was in.
- A heading for each block whose on-screen label was a control, such as a tab.
- Contact details and addresses written out in full, and link URLs where the link is the information.
- Maps and charts that carry information, sized to fit with room to spare.
Rules of thumb
- Force light colors in print. Browsers leave out background colors by default when printing, so light text from a dark theme comes out as pale text on white paper. Redefine the color tokens under
@media print. - Keep units whole. Use
break-inside: avoidon cards, table rows, figures and callouts, andbreak-after: avoidon headings so one never ends a page. - Do not force page breaks unless each section really belongs on its own sheet. A forced break usually leaves a half-empty page.
- Give every page a header and footer. Draw both in the page margins with
@pagemargin boxes so they repeat on every sheet. The header has the name and a short subtitle on the left, a contact or version and date on the right, and in the center a title for what that page is about: give each group of sections a named page (page: menu) whose@top-centerholds its title. A new named page always starts a new sheet, so group short sections together. The footer has a short note on the left and"Page " counter(page) " of " counter(pages)on the right. Give@pagea white background, or a dark theme fills the margins. - Do not fix the paper size. Set a margin in
@pageand leave the size alone so Letter and A4 both work. - Watch for duplicates. A footer that repeats the address and hours printed above it can spill onto a page of its own.
- Match the selector weight. A print rule that hides shared page chrome needs the same selector weight as the screen rule that shows it, or it does nothing.
Starting point
@media print {
@page { margin: 0.5in; }
/* Light, whatever the screen mode */
:root, :root[data-theme="dark"] {
color-scheme: light;
--canvas: #ffffff;
--text: #1f1912;
--muted: #4a4036;
}
/* Controls, live state and decoration */
.site-header, .filters, .tabs, .booking-form,
.open-now, .hero-art { display: none !important; }
/* Content hidden behind tabs prints too */
.page .tab-panel[hidden] { display: block !important; }
/* Header and footer on every page, drawn in the margins */
@page {
background: #ffffff;
@top-left { content: "Site name"; }
@top-right { content: "Phone or date"; }
@bottom-left { content: "A short note."; }
@bottom-right { content: "Page " counter(page) " of " counter(pages); }
}
/* The center title follows the section on that page */
@page menu { @top-center { content: "Menu"; } }
@page visit { @top-center { content: "Visit"; } }
.menu { page: menu; }
.visit { page: visit; }
/* Keep units whole */
.card, figure, tr { break-inside: avoid; }
h2, h3 { break-after: avoid; }
}
Worked example: the restaurant template
The restaurant template had no print styles. Printed to Letter before and after adding them:
| Check | Before | After |
|---|---|---|
| Pages | 9, unnumbered | 6, each with a header titled for its section (Menu, The Kitchen, Visit and Book) and a "Page 1 of 6" footer |
| Menu courses printed | 1 of 5 (only the open tab) | 5 of 5, each under its own heading |
| Colors | Dark theme; cream text on white paper once backgrounds are dropped | Ink on white |
| Live state | "Open now until 4pm" and a "Today" badge, frozen on paper | Left out; the full weekly hours remain |
| Controls and art | Header, buttons, filters, booking form, two full-page illustrations | Left out |
| Page splits | Hours card split across two pages | Every card, dish and table kept whole |
5. Bugs that keep coming back
Each of these shipped at least once in this project, most of them in more than one place. Check for them by name.
Screen layout
- Bare
1frgrid tracks. A1frtrack will not shrink below its content, so a wide table pushes the page wider. Writeminmax(0, 1fr), in every media query that redefines the grid. - Flex items that will not shrink. A flex child's minimum width is its content width. Give it
min-width: 0so an inner scroll area can scroll. overflowresettingoverflow-x. The shorthand silently undoes an earlieroverflow-x: auto.gapplus margins. Children of agapcontainer should not also carry margins in that direction; the two add up.displaybeatinghidden. Any rule that setsdisplayoverrides thehiddenattribute. Guard it with[hidden] { display: none !important; }and check hidden things by their rendered box.- Targets under a sticky header. In-page links and focused fields need
scroll-margin-topat least the header's height. - Focus rings on the wrong surface. Measure the ring against what is directly behind it, which is not always the page background.
- Opacity as de-emphasis. Lower opacity lowers contrast. Use a measured color instead, and show scroll-reveal content under reduced motion and in print.
var()in SVG attributes.fill="var(--x)"does not resolve. Use a CSS rule orcurrentColor.
- Hidden tab panels. Only the open tab prints. Show every panel and give each one a heading.
- Dark mode on paper. Backgrounds are dropped, light text stays, and the page comes out unreadable.
- Frozen live state. "Open now", "Today" and countdowns are wrong by the time anyone reads the paper.
- Art filling pages. Hero illustrations and decorative frames each take most of a sheet.
- Forced page breaks. A
break-before: pageon a short section leaves the page before it mostly empty. - Print rules that lose. Shared chrome styled as
.panel.panelignores a print rule written as.panel.
6. Tools
Everything here runs in headless Chrome or Edge, with no packages to install. Always use a scratch profile in the temp folder, and delete it afterwards.
# Screenshot at one width chrome --headless=new --disable-gpu --no-first-run --disable-extensions \ --user-data-dir=<temp>/profile --window-size=1440,1000 \ --virtual-time-budget=2500 --screenshot=out.png "file:///<path>/index.html" # Print to a Letter PDF chrome --headless=new --disable-gpu --no-first-run --disable-extensions \ --user-data-dir=<temp>/profile --no-pdf-header-footer \ --virtual-time-budget=4000 --print-to-pdf=out.pdf "file:///<path>/index.html"
Things that make a check lie
- No virtual time budget. The capture fires before scripts run, so it shows a page nobody will ever see.
- No scratch profile. Extension messages bury the page's own console errors.
- Narrow windows.
--window-sizeis clamped near 500px. For 320 and 375, set the viewport with the DevTools Protocol'sEmulation.setDeviceMetricsOverride. - Clicking below the fold. Protocol mouse events use viewport coordinates. A click on a control that is off screen hits nothing and still reports success.
- Checking one width. A clean result at 1440px says nothing about 375px.
- Blaming the page for a harness bug. Before filing a defect, check that the test itself is right. Four working forms once looked broken because of a harness bug.
7. Checklist before you ship
8. Sources and versions
- WCAG 2.2: success criteria 1.4.10 (reflow), 2.1.1 (keyboard), 2.4.7 (focus visible), 2.5.8 (target size) and 4.1.2 (name, role, value).
- CSS Fragmentation Module Level 3:
break-inside,break-beforeandbreak-after. - CSS Paged Media Module Level 3: the
@pagerule and page margins. - Headless Chrome: the screenshot and print-to-PDF commands in section 6.
- Template Interface Color Standard: rule 6 and the contrast checks in section 3.
Version 1.0, 2026-11-22. First release. Drawn from this project's template reviews and the print test on the restaurant template. Changes will be versioned here.