---
name: ui-deslop
description: Use when a UI component that an AI agent generated (or any draft component) already works but looks slightly off, and the user wants it fixed detail by detail before shipping — triggers on "ui-deslop", "UI 슬롭 다듬어", "생성된 UI 디테일 잡아줘", "fix the details of this generated UI", "polish this component pixel by pixel", "attention-to-detail pass". NOT for picking a visual direction, restyling a whole page, or building new UI. Args: target component (file path, or URL + selector; required); optional list of states (hover, focus, open/expanded) and themes (dark, increased contrast, color tints) the product supports.
---

# ui-deslop — a measured detail pass on one generated component

This is the order of fixes shown in Haz's 65-second video "Fixing a Claude-generated UI with obsessive attention to detail." (X, 2026-11-15), plus rules he stated in replies under it. The video has no narration or captions: each step below restates what the video shows. When the video shows a change but gives no rule or value, the step says so. Do not fill those gaps with your own numbers and present them as the method.

The author says he decides with "Gestalt principles and accessibility guidelines" and taste from 20+ years of design. He does not list which principles. He publishes no prompts.

## Inputs

- One component, rendered in a real browser, in every state it has: default, hover, focus, open/expanded.
- The themes the product supports: light, dark, increased contrast, color tints.
- A way to measure rendered boxes (devtools, or `getBoundingClientRect()` from a script) and to read the accessibility tree (devtools Accessibility pane, or an accessibility snapshot).

## Before you start

1. Screenshot every state and theme of the component as it is now. These are the "before" images for step 10.
2. Work on one component at a time. Select it and look at it zoomed in.
3. Measure in the units the code uses. The author's values are rem/em, so measured numbers can be fractional (11.2, 15.2). He says browsers handle fractional values well. To land on whole pixels anyway, wrap the value: `padding: round(0.35em, 1px)`. Fact note, not from the source: this rounds to whole CSS pixels; on a 1.5x display that is still not a whole number of device pixels.
4. Record every measurement as `before → after`. Mark a value red while it differs from the values it should match and green when it matches. The video draws these as red and green labels.

## Steps — in the video's order

### 1. Corner element: equal distance to both edges

Take the element in the container's top-left corner (in the video: the round icon badge of a timeline card). Measure from its rendered shape to the container's top edge and to its left edge. Change the padding around it (on the container, or on the row inside it that carries the hover background) until both distances are equal.

- Video: top 8, left 12 → 11.2 and 11.2.
- The author on these fixes: "It's not about the number, but about the values being the same on both axes." (reply, 2026-11-16)
- Keep the element on any axis it shares with its siblings. In the video the badge stays centered on the timeline's vertical line while the card padding changes.

### 2. Gap to the next element = the same distance

Measure the gap between that corner element and the content beside it (badge → title text). Make it equal to the edge distance from step 1.

- Video: 6 → 11.2.

### 3. Opposite corner control: equal distance to its two edges

Take the control in the other corner (in the video: the expand chevron, top-right). Measure its icon box, not only the glyph, to the top edge and the right edge. Make the two equal.

- Video: top 12, right 16 → 15.2 and 15.2.
- The video uses a different value here than in step 1 and does not say why. Do not force the two corners to one value unless your spacing system defines it.

Optional recipe, from a post the author linked as "useful" for this work ("CSS 🤝🏽 Math — How to get even margins without ignoring line-height", X, 2026-01-17). It is for a pill or row of text with an icon on the end:

```css
.item {
  --py: 0.875em;                                   /* the only value you set */
  --px: calc(var(--py) + (1lh - 1cap) / 2);         /* horizontal padding next to text */
  padding: var(--py) var(--px);
}
.item .icon {
  width: 1lh; height: 1lh;                          /* icon as tall as one line */
  margin-right: calc(var(--py) - var(--px));        /* icon sits --py from the edge */
}
```

Fact note, not from the source: `(1lh - 1cap) / 2` equals the space above the capitals only when the font's ascent minus its cap height equals its descent; for other fonts it is an approximation.

### 4. Whole-component type and surface

Re-render the whole component and compare it with the "before" at full size. In this step the video makes the text and the row spacing larger and changes the card surface from light gray to white. It shows no values and no rule.

- Check every text size and row spacing against your product's own type scale and spacing tokens. Replace values that drift from them. The source gives no sizes.
- The gray-to-white surface change is this author's choice for this component. The source gives no rule for it. Make it only if the tinted surface is the same kind of drift in your product.

Edges, from the author's reply about this card:

- Light mode: an outer 1px shadow as the edge. Dark mode: a border.
- Do not use 0.5px edges. They render inconsistently on 1x and fractional-scaling displays. To make an edge lighter, lower its opacity.
- Match related line widths. Here the comment box border width matches the timeline guide line width.

### 5. Hover: nothing may disappear into the hover background

Step through the hover state slowly (the video scrubs it with a slider). Watch every element that has its own backdrop on the hovered surface. If a backdrop blends into the hover background, change it on hover too.

- Video: the gray circle behind the comment icon vanishes into the gray hover background. Fix: the circle also darkens on hover and stays visible.

### 6. Hover while open: no hard edge between header and body

Open the component while the pointer is over its header. If the header's hover background stops at a hard edge above the revealed body, fade it out into the body.

- Video: hard edge → vertical gradient fade.
- One viewer in the thread found the gradient too harsh. The strength of the fade is a judgment call; the source gives no value.

### 7. Motion: no instant open/close

If opening or closing is instant (0 ms), add a transition in both directions.

- Video: 0 ms → 300 ms with an eased, S-shaped curve. The easing function is not named.

### 8. Accessible name: the event only

Focus the interactive element and read its accessible name and description in the accessibility tree.

- Video: `name: "tobias commented 2 days ago", description: none` → `name: "tobias commented", description: "2 days ago"`.
- Keep the name to what the control is (the event). Move secondary information, such as the timestamp, to the description.
- The video shows only the inspector result, not the markup. In HTML: if the timestamp is outside the button, `aria-describedby` on the button pointing at it gives this result. If the timestamp is inside the button, the name is computed from all of the button's text, so also point `aria-labelledby` at the title element. Check the result in the accessibility tree, not in the markup.

### 9. Themes: dark, increased contrast, tints

Switch to each theme the product supports and look at every state again.

- Video, dark mode: same layout, card and badges on dark surfaces.
- Video, increased contrast: pure black background, a white border around the card, icon badges without filled circles, the approval check drawn as an outlined circle, brighter secondary text.
- Video, color tint: picking the purple swatch tints the whole surface, cards, badges and label; picking white returns to neutral.
- The video shows these results but no rules for how to derive them.

### 10. Before/after

Compare the final render with the "before" from the start, at the same size, for every state and theme you touched. The video uses a wipe line moving across the two versions.

## Done when

- Each corner element: both edge distances are equal, and its gap to the next element equals them. Numbers recorded as `before → after`.
- Hover: every backdrop stays visible on the hovered surface.
- Open + hover: no hard edge between the header's hover background and the body.
- Open and close are animated in both directions; nothing is 0 ms.
- The accessible name is the event only; the timestamp or other secondary text is in the description, checked in the accessibility tree.
- No edge is thinner than 1px; light/dark edges follow step 4.
- Every theme the product supports was rendered and looked at.
- Before/after screenshots exist for every state and theme you changed.

## Not in the source

- Why a value was chosen (11.2, 15.2), type sizes, colors, the easing function, code for the component.
- The author's own rule set, "a collection of instructions and code recipes with all these rules built in", was not released on 2026-11-16. He planned to launch it by the end of 2026.

Credit: workflow from Haz (@diegohaz), "Fixing a Claude-generated UI with obsessive attention to detail.", X, 2026-11-15 — https://x.com/diegohaz/status/2121696559955919147 — with his replies in that thread and his linked post https://x.com/diegohaz/status/2012202785551327265. Extracted for dosi.dev.
