I asked a coding tool for a compact ledger table, with amounts that line up and a useful empty state. What I got back was a dark card, a purple-to-pink gradient, a glow, four KPI tiles, and a decorative sparkline with no data in it. The table, such as it was, had been turned into a stack of rounded row cards. The empty state said "No data".
That look is not a taste problem. It is a default. The models have seen a lot of marketing sites and generated dashboards, and they will keep emitting that chrome unless you give them a narrower contract, in the repo, that a script can also check.
This is the contract I use for data-heavy screens, plus a small Node checker. I ran the checker on two fixtures: a compact ledger table passed; a "welcome back to your insights" panel failed with nine violations, including the gradient, the glow, the sparkline, and the empty state.
Put the rules in a file the tool can read
A paragraph in a chat window lasts one session. A UI_RULES.md file at the root of the frontend is still there when someone types "add a status column." It should be short, specific, and boring.
The useful parts are not "make it look premium." They are constraints:
- Use only the tokens in
tokens.css. Do not invent a colour, a font, a radius or a shadow. - A table is a
table. Do not fake rows with a stack of cards. - Numeric cells use a
.numericclass: right aligned, with tabular numerals. - Every data view has loading, empty, error and ready states. Empty states name the gap and offer one action. Errors stay on the view that failed, with a retry.
- Purple and indigo gradients, coloured glows, pill-shaped content cards, backdrop blur on panels, and charts with no data are banned.
Point the tool at that file before it edits UI. Then check the result with a script, because the model will still try a gradient when it wants to be helpful.
Tokens first, named by role
If the only legal colours live in one file, a generator has less room to invent a palette. Name tokens by role, not by hue. A button does not use --blue-600. It uses --accent-fill.
:root { --font: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", sans-serif; --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace; --text: #14161a; --text-muted: #5b6270; --surface: #ffffff; --surface-raised: #f6f7f9; --line: #e3e6eb; --accent-fill: #2f5fe0; --danger-fill: #c8352b; --cell-pad: 8px 12px; --row-height: 36px; --radius: 6px; --shadow: 0 1px 2px rgb(20 22 26 / 8%); } [data-density="compact"] { --row-height: 28px; --cell-pad: 4px 8px; } IBM Plex is here as an example of a typeface with tabular figures, with a system fallback so the page still works if the webfont is missing. If your product already has a font, put that on --font and do not let a tool introduce Inter as a second stack. Inter is not a bad typeface. It is just the one the models reach for when nobody has told them the product already chose.
Density is a token, not a restyle. People who work through hundreds of rows a day want a shorter row. Occasional users may want more air. A data-density attribute that only changes --row-height and --cell-pad covers both without two sets of components.
Accent is for actions and focus. It is not a wash behind the page, and it is not a glow around a card. The legal shadow is short and neutral. If a panel needs to sit on the surface, a one-pixel --line border is usually enough.
Make the numbers sit still
In a ledger, a payments grid or a log, the numbers are the product. If a column of amounts jitters as the values change from 99 to 1,000, the table is harder to scan than it looks in a screenshot.
.data-table .numeric { text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; } Use .numeric on amounts, counts, IDs and dates that must compare in a column. Right-align those cells; left-align labels and names. Keep the column header aligned with the cells, and keep the header visible while the body scrolls.
This is also a cheap test for slop. If the generated markup has no .numeric class, the tool did not build a table for work. It built a picture of a table.
A table is a table
A data-heavy screen can have a panel, a filter row and a dense grid. It does not need a hero, a "welcome back", or four KPI cards that repeat totals the table already shows. It does not need a sparkline unless you have a series and a reason to plot it.
Use table, thead, th and td. Row height comes from --row-height. Padding comes from --cell-pad. A sticky header is enough chrome.
Loading should keep that layout. A skeleton row with the same column count and the same height is useful. A centred spinner that replaces the page is not: the screen jumps when data arrives, and the user cannot tell how large the view will be.
Write the states as if they are the product
Most of a data view's life is not the happy path. The contract therefore requires four states, and the markup has to mean them.
<div class="state" data-state="empty"> <strong>No posted EUR lines in November.</strong> Clear the amount filter to see the rest of the month, or <a class="action" href="/lines/new">add a line</a>. </div> <div class="state" data-state="error"> <strong>The ledger failed to load.</strong> The list request returned 503. The rest of the page is still available. <button class="retry" type="button">Retry</button> </div> The empty state says what is missing, in the language of the current filters, and offers one next action. "No data" is banned. The error stays on the view that failed, names the failure, and lets the user retry. A toast is not a substitute. The rest of the dashboard should keep working.
Check the output, do not just prompt for it
Rules in a markdown file are still suggestions. A small Node script, check.mjs, walks CSS and HTML and fails the build when the bans are broken. It has no dependencies. You run it on a path:
node check.mjs src/ui It flags, among other things:
-
linear-gradientorbox-shadowthat uses the usual generated purples (#6366f1,#8b5cf6,#a855f7,#7c3aed) -
box-shadowwith a blur of 16px or more, which reads as a glow even in grey -
backdrop-filteron panels -
border-radiusof 16px or more, or9999pxpills on layout, instead of--radius - a new
font-family: Interin component CSS - a
.sparklinewith nodata-values - an empty state whose only text is "No data"
- a
tablethat never uses.numeric, or a table stylesheet that never setstabular-numsandtext-align: right
I ran it against three fixtures. The compact ledger table and its states exited 0. The gradient dashboard exited 1, with nine violations. A table that used <table> but not .numeric or tabular numerals exited 1, with those three typography errors. Neutral skeleton gradients that only use --surface-raised and --line are allowed; the checker looks for the banned hues, not for the word linear-gradient.
That last point matters. A loading row may shimmer. A marketing wash may not.
Put the script next to UI_RULES.md and tokens.css, and run it in CI on the paths a tool is allowed to touch. When a generator still emits a glow, the failure is a file and a rule id, not a feeling.
Pitfalls
Do not ban every gradient. Skeleton rows and some charts need them. Ban the palette and the glow, and keep token-only neutrals.
Do not fight a font you already use. If the product is already in Inter, Inter belongs in --font. The check is there to stop a second, unasked-for stack.
A linter cannot judge taste. It will not tell you that a KPI tile is repeating the table, or that a chart has the wrong series. It will tell you the sparkline had no data, the empty state had no action, and the amounts were not tabular. That is the layer worth automating.
Keep the contract short. If the markdown file becomes a design-system book, the model will skip it. The essay I already wrote about tokens, states and keyboard use can live elsewhere. The contract should stay a page of constraints.
Check the HTML the tool actually wrote. A perfect tokens.css does not help if the screen is a pile of unclassed divs. The typography rules only fire when a table is present, which is why the "row card" fixture fails on the glow and the radius first.
The point is not to make every screen austere. It is to stop a coding tool from turning a working table into a poster. Give it tokens, a short contract, and a check that can fail. Then ask for the table again.
I'm Aran Shayan, a software engineer at SOHA who builds data-heavy interfaces and the APIs behind them. More at aranshayan.com.
