SShortSingh.
Back to feed

Pin AI Coding Agents to the Existing Typography Scale, Avoiding Magic Font-Size Values

0
·4 views

A developer argues that magic font-size values in agent-generated UI code, such as text-[17px] or arbitrary line-heights, should be treated as scale violations rather than visual preferences. Such one-off sizes arise when models copy mockup pixel values, lack the design tokens, split the difference between existing steps, or mirror stale numbers in neighboring files. The recommended fix is to paste the project's named typography scale into the prompt and forbid raw px or rem values, snapping off-grid mockups to the nearest step. The author also suggests grepping diffs for raw font-size, line-height, and tracking patterns, with lint rules kept as a backstop. Exceptions are limited to documented cases like unstyled third-party embeds or chart labels outside the design system.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingHacker News ·

HN Asks: Has AI Produced Anything Truly New on Its Own?

A Hacker News user asks the community to name something genuinely new that an AI system has accomplished entirely by itself. The poster notes that after two years of AI development, they have not yet encountered such an example. In their view, apparent discoveries usually depend on a human identifying the novel element. Alternatively, the models appear to be merely combining existing data from separate sources that had never been connected. The post drew 4 points and 7 comments at the time it was captured.

0
ProgrammingHacker News ·

Haskell community publishes a technical vision for its ecosystem

A technical vision document for the Haskell ecosystem has been posted on the Haskell Discourse forum. The post was shared on Hacker News, where it gathered 4 points and no comments at the time of capture. The source material provided contains only the links and engagement metrics, so the specific proposals in the vision are not described here. Readers are directed to the Discourse thread for the full content and any community discussion.

0
ProgrammingDEV Community ·

Connector design should expose partial failures so agents can tell empty results from errors

A connector returning an empty array can signal several different outcomes, including a successful query with no matches, a request that failed before reaching the service, a partially loaded result, or unparseable data. The article argues these should be distinguished, since an agent cannot safely decide its next step if all of them appear as an empty list. It proposes returning results as structured reports that state the status (complete, empty, partial, retryable error, or action required), the source, the fetch time, and any continuation cursor or warnings. Continuation cursors should be saved only after a page is accepted, so an interrupted pagination can resume rather than presenting an incomplete list as complete. For write operations, the author recommends idempotency keys and recording whether an operation was confirmed, since a timeout after a write leaves the outcome ambiguous.