Beyond The Vibe, home

BlogVerification

Why does AI-built UI look slightly off?

An agent draws every button from scratch. I counted the one-off values in a mockup, then ran a design linter on the app built from it. It found 21.

Florian van der Galiën

You can often tell that an agent built an interface, even when every screen looks fine by itself. One button has a little more padding than the one on the next page. Two cards have different corners. A grey appears that is close to the grey you chose.

The reason is simple. An agent doesn’t remember what it built last week. Ask it for a settings page today and it writes a button, with whatever padding looks right in that moment. Ask it for a checkout page next week and it writes a button again. Each one is reasonable. They just aren’t the same button.

I wanted numbers for this, so I took them from the travel log app I build in the course.

A mockup has no system, and that’s fine

Before any real code, I had a model draw the app as HTML so I could see it and react to it. Three concepts took it about a quarter of an hour, and I had it combine the two I liked into one file.

The mockup: a page called Your atlas with a map, four number tiles and two large photo cards for trips.

I like this mockup. I also counted what is inside its stylesheet:

In one 68 KB mockup file Distinct values
Colours 63
Paddings 33
Corner radii 22
Font sizes 9

Thirty-three different paddings in one file. For a mockup that doesn’t matter, because nobody will maintain it. If the app were built the same way, every later change would add a thirty-fourth.

Tokens and components give the agent one place to look

So the app is not built that way. It has two things the mockup doesn’t.

The first is a set of tokens: named values for colour, spacing and radius, defined once in the stylesheet. The app’s stylesheet defines 106 of them. A page says “the card colour”, not a hex value.

The second is a component library. I use shadcn-vue, where a button is a file in the project with a fixed list of looks. The button in the travel log has nine variants and eight sizes. A page picks from that list.

The built app: the same Your atlas page as in the mockup, now with a navigation bar, real data and the same photo cards.

The built app looks like the mockup, which was the point. Components alone don’t settle the consistency question, though.

What a design linter finds

A component with nine variants still accepts extra classes from the page that uses it. Nothing stops an agent from taking the button and adding its own corner radius on top.

There is a linter for exactly this, @shadcn/lint. You tell it which parts of a component a page may change, and it reports the rest. The travel log runs it with three rules: a page may not restyle a component, may not use a colour outside the tokens, and may not use a one-off value such as p-[13px].

When I ran it on 20 November 2026, it reported 21 findings: 13 restyled components and 8 one-off values. Three of them are the zoom buttons on the map:

src/components/trips/TripMap.vue
  45:70  error  "rounded-xl" is not allowed on <Button>: <Button> owns its shape.
         Use a variant: default, outline, secondary, ghost, destructive, link,
         photo, glass, cta. Add a new variant in src/components/ui/button/Button.vue
         only if the design explicitly calls for a treatment none of these provides

The map’s zoom buttons have squarer corners than every other button in the app. Here they are, below three buttons that use the component as it is:

A detail of the trip page: three pill-shaped buttons labelled New entry, Edit trip and Delete trip, and below them a map with three zoom buttons whose corners are squarer.

The difference is a few pixels of corner radius, which is easy to miss on a full page. One card on the same page overrides the card component’s corners, its padding, its gap and its shadow, four findings on a single line. An avatar sets its own font size in two places.

The message is written for an agent as much as for me. It names the file, says what the component owns, lists the variants that exist and says when a new one is justified. An agent that reads it has what it needs to fix the line without asking.

Two things to know before you set it up

The linter comes for both Oxlint and ESLint, and the choice matters. Under Oxlint it reads the script part of a Vue file and not the template, and the template is where the class names are. The design linter’s documentation says so plainly. To read templates it has to run through ESLint, with a parser for Vue files and one for Astro files. So the travel log runs ESLint for this one job and Oxlint for everything else.

Not every finding is a mistake. Three of the eight one-off values are system colours such as Canvas and Highlight, used only in high-contrast mode, where the operating system picks the colours and the tokens don’t apply. Those are correct as they are. They get an exception with the reason written next to it, the same way I handle lint exceptions in code.

Where this leaves the app

The 21 findings are still open, and the design check is not yet part of the command that has to pass before a change counts as done. It will be once the list is at zero, because a check that already fails gets ignored.

If you have a prototype from Lovable, Bolt or v0 and it looks slightly off, this is where I’d look first. Count the distinct colours and paddings. Then give the agent one place to take them from and a check that tells it when it didn’t.

This is one rung of a longer ladder of checks. The others are in How do you know AI-written code works? The plan this app was built from is the subject of Let the agent interview you before it builds sign-in.