Menu

Pin the agent to the existing typography scale — no magic font-size values
📰

Pin the agent to the existing typography scale — no magic font-size values

DEV Community: css·Sherotree·2 days ago
#gappzZ1X
#devtocss#devto#dev#font#size
Reading 0:00
15s threshold

The new empty state looks “almost” like the others. Then you notice text-[17px] , or font-size: 15px , or a line-height: 1.4375 next to a heading that should have been text-lg / font-size-300 . The scale already had a step. The agent made a new one.

I’ve started treating magic font-size values in agent UI diffs as a scale violation, not a visual preference. One-off sizes are how products grow four “body” sizes that nobody can name.

Why agents invent sizes

The screenshot or mock was 17px, and the model copied the number

It didn’t have the scale (tokens, Tailwind theme, or type.css)

It “split the difference” between text-sm and text-base

A previous file already used a magic number, and the agent matched that file

Pixels in a design file are a hint. The scale is the contract.

What to hand the agent

Paste the scale, not a lecture.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.