For weeks I had been checking this site by measuring it: no horizontal overflow, no duplicate ids, every image sized, every link resolving. All true. Then I rendered the home page with headless Chrome at a handful of real viewport widths and looked at the pictures, and found two defects in the first screen that no measurement had caught.
What the numbers missed
The hero's 3D keyboard sat on top of the text. At widths from about 1024 to 1366 — most laptops — the decorative canvas extended left far enough to cover the end of the location line and touch one of the buttons. Nothing overflowed; the canvas is absolutely positioned and clipped by its section. It was simply in the wrong place, which is not something any of the checks were looking for.
On phones, the stats row left a hole. Four stats in a grid using repeat(auto-fit, minmax(150px, 1fr)) fit three to a row at phone width, which put the fourth on its own beside an empty grey cell. Again: nothing broken, every measurement clean, and obviously wrong the moment you see it.
Both fixes were small — a narrower, further-right canvas with a second step below 1280px, and a two-column grid that becomes four at tablet width. Finding them was the work.
The setup
You do not need a testing framework. If Chrome is installed, it already runs headless:
chrome --headless=new --hide-scrollbars \
--window-size=1280,800 \
--virtual-time-budget=6000 \
--screenshot=home-1280.png \
http://localhost:4321/Point it at a production build rather than the dev server, so you see what ships. Run it at the widths people actually use — a phone, 1024, 1280, 1366, 1536 — and look at each one. The whole thing is a short shell loop.
Three ways the screenshots lied
The tool is honest, but it is easy to read it wrong. Each of these sent me chasing a bug that was not there.
Animations get photographed mid-flight. The first hero screenshot showed the name as "Ar" with a cursor, because the typewriter effect was still running. --virtual-time-budget lets the page's timers run forward before the shot is taken; give it longer than your longest entrance animation.
Very narrow windows are not what you asked for. A screenshot at 420px showed article text cut off at the right edge, which looked like a serious overflow on mobile. Emulating a 375px phone properly in a browser and measuring scrollWidth showed no overflow at all. Whatever the window was doing, the screenshot was not the page at 420px. For phone widths, use real device emulation and measure; use window screenshots for everything from tablet up.
The preview server is not the host. Rendering /articles/some-post against the local static preview returned the home page, because that server does not do the extensionless URLs the real host does. The fix is to request /articles/some-post/index.html locally. Without noticing, I would have been reviewing the wrong page.
What it is good for
Measurements answer questions you already thought to ask: is anything wider than the screen, is this element present. Layout bugs are mostly not that kind of question. They are "this looks wrong", and the only test for that is looking.
A dozen screenshots at five widths take a minute to produce and a few minutes to look through. That found more real defects in one pass than a month of careful automated checks, and it is now part of how changes to this site get finished: build, render, look, then commit.