UI polish
Polish is many small details that compound. Keep the project's components, tokens, density and motion language. The values here are tested defaults, so use them as written when the project has nothing of its own, rather than a familiar-looking substitute.
When reviewing motion, slow it down (10% in the browser's Animations panel). What feels off slowly is subtly wrong at full speed.
Text rendering belongs to better-typography, hit areas and reduced motion to better-accessibility, grouping and spacing to better-layout.
Surfaces
- Concentric radius. Outer radius = inner radius + padding (card
rounded-2xl p-2holdsrounded-lg). Same radius on both is the most common "feels off" cause. Past about24pxof padding the layers read as separate surfaces; pick radii independently. - Optical alignment. Icon-side padding = text-side padding minus
2px(ps-4 pe-3.5for a trailing icon). Play triangles shift right about2px. Fix asymmetric icons (stars, carets) in the SVG first, atranslate-x-pxwrapper second. - Shadows for depth, borders for structure. Where a border only creates elevation on cards, buttons or popovers, a layered transparent shadow adapts to any background. Keep borders for dividers, table cells, inputs and selected or focus states.
- Image outlines.
1pxoutline,-1pxoffset:oklch(0 0 0 / 0.1)light,oklch(1 0 0 / 0.1)dark (outline-black/10 dark:outline-white/10). Use pure black or white, not slate or zinc: a tinted outline picks up the surface and reads as dirt on the edge.
Shadow tokens and recipes: references/surfaces.md.
Icons
- Stroke follows adjacent text weight:
1.5pxbeside 400,2pxbeside 500 to 600,2.5pxbeside bold. One library and one stroke convention per surface. - One SVG with
currentColor; hover, selected and disabled come from CSS color and opacity. Strip hardcoded fills on import. - Outline is the default state, fill the active state. Don't use them interchangeably.
- Size inline icons at
1emto1.25em, on the set's native grid (16, 20, 24), and check them at the smallest render size.
Load references/icons.md for RTL flipping rules and the icon cross-fade code.
Motion
- Interruptible. CSS transitions (or springs) for interactive state, because they retarget mid-flight. Keyframes only for one-shot sequences.
- Restraint. High-frequency interactions (typing, row hover, tab switches) get instant feedback or at most
150mson opacity and color. Save expressive motion for rare moments. Every animated change also leaves a static cue (color, icon, label). - Press.
scale(0.96)on:active,150ms ease-out. Below0.95feels exaggerated. Offer astaticprop to turn it off. - Contextual icon swap. Scale
0.25to1, opacity0to1, blur4pxto0. Withmotion/framer-motion(match the import already used):{ type: "spring", duration: 0.3, bounce: 0 }. Without one, keep both icons in the DOM and cross-fade withcubic-bezier(0.2, 0, 0, 1)over300ms; don't add a dependency for this. - Enter. Only for infrequent staged entrances: split into semantic chunks (title, text, actions), stagger about
100ms(words in a title about80ms), combine opacity,translateY(12px)andblur(4px). - Exit. Softer and shorter than enter: small fixed
translateY(-12px), about150ms ease-out. Remove instantly when motion adds no information. - First render.
initial={false}onAnimatePresencestops toggles animating on load. Don't use it where the entrance itself is the point (hero stagger). - Theme switch. Disable all transitions during the swap, force a reflow, remove on the next frame, or the page smears.
next-themeshasdisableTransitionOnChange. - Performance. Name transitioned properties (
transition-[scale,opacity]), nevertransition: all.will-changeonly ontransform,opacityorfilter, and only after you see first-frame stutter.
Code for each: references/motion.md.
Reporting (standalone)
HIGH: breaks an interaction or leaves a state visible only during animation. MEDIUM: visible inconsistency in surfaces, icons or motion. LOW: isolated polish. One row per root cause: Severity, Location (path:line), Before, After, Why. Check every defined state (hover, focus, active, loading, empty); mark what you couldn't run Not verified. End with Block if any HIGH, else Approve.


