Hairlines
Four ways to draw a one-pixel line, and what a screen does with each.
The grid lines ruling this site are one pixel wide, and getting them to agree took longer than anything else here. A browser picks its own rhythm for a dashed border and will not take one from you.
What you see
Real lines on your screen, nudged like a scroll or a resize moves them.
Snapped · jumps a pixel, changes width
Smoothed · stays put, brightens and dims
Why
Screen pixels at 150%, drawn big. Blue is the true line.
Snapped · sharp, same width
Smoothed · even, but grey
What it is
A side-by-side test of the dashed one-pixel lines that frame this site. You can nudge a line by fractions of a pixel: one version jumps between pixels and changes width, while the other stays in place but fades.
Why I needed it
I wanted every line on my site to look the same. Instead, the same line looked thinner in some places and thicker in others depending on the screen’s scaling, so I built this to see what was happening.
How I did it
I set up the test and built it with Claude Code, comparing four ways to draw the line at different scalings. At 150%, a line falls between pixels and gets blurred across both. Rounding it onto whole pixels keeps it sharp but uneven, while blending keeps it even but soft. This site uses the sharp version.