UI-polish principles for product interfaces. Use when building or reviewing surfaces, border radius, optical alignment, shadows and borders, image outlines, adaptive chips, hover gating on touch, scroll containment in overlays, icon stroke weight, icon states, or surface details that look off.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Better Ui?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tommylower-better-ui)
---
name: better-ui
description: UI-polish principles for product interfaces. Use when building or reviewing surfaces, border radius, optical alignment, shadows and borders, image outlines, adaptive chips, hover gating on touch, scroll containment in overlays, icon stroke weight, icon states, or surface details that look off.
author: Jakub Krehel (https://github.com/jakubkrehel/skills) adapted for Cortex
---
# UI polish
This skill holds the visual polish for surfaces and icons, with the value each detail takes. It applies once the underlying interaction is sound, and a polish finding never outranks a broken interaction.
Adapted from Jakub Krehel's [`better-ui`](https://github.com/jakubkrehel/skills/tree/main/skills/better-ui) at commit `672ae44ace6aaed65b86cbb1e2fd6fbea0e79578`.
## Fallback values, optional polish
The values below are fallback recipes. Use one only when neither the project nor Studio sets a value, and never let it override either source. When you do fall back to one, start from the stated value rather than a rough approximation: an outline at `oklch(0 0 0 / 0.1)` is not one at `0.15`, and a `1.5px` stroke is not `2px`. The optical nudges and the concentric padding cutoff are starting points, judged by eye.
Keep the project's component library, tokens and density. A deliberate and consistent project convention, such as a style with no shadows, is a preference and not a finding. The same detail done two ways within the project is a finding.
Text wrapping, font rendering, tabular numbers and text spacing belong to `better-typography`. Hit areas, keyboard support, ARIA and the reduced-motion requirement belong to `better-accessibility`. Grouping, section spacing, breakpoints and spatial RTL belong to `better-layout`, except directional icon mirroring. Color tokens and contrast measurement belong to `better-colors`. Transitions, enters and exits, icon swaps, press feedback and every other animation belong to `better-motion`.
## Outer radius equals inner radius plus padding
Where nested surfaces share a visible, even inset, the outer radius is the inner radius plus the padding plus any border width. Past `24px` of padding, or where the padding is deliberately asymmetric, treat the layers as separate surfaces and keep each one's radius token. Recipes are in [surfaces.md](references/surfaces.md).
## Align optically where geometry looks off
Where geometric centering looks off, nudge by eye. Give a button `2px` less padding on its icon side, shift a play triangle toward its point and fix asymmetric glyphs in the SVG itself. Recipes are in [surfaces.md](references/surfaces.md#optical-alignment).
## Shadows for elevation, borders for structure
Where a border exists only to create depth, replace it with layered transparent `box-shadow` values. Keep borders on dividers, separators, table cells and selected states. Keep them on form inputs too, whose boundary needs 3:1 non-text contrast under `better-accessibility`. Focus rings belong to `better-accessibility` as well.
Forced-colors mode removes every `box-shadow`. Keep `border: 1px solid transparent` under a shadow ring so that mode still draws an edge. Recipes are in [surfaces.md](references/surfaces.md#shadow-recipes).
## Derive adaptive chips, don't blend by default
For neutral chips and badges placed on changing surfaces, inherit the surface foreground with `currentColor` and derive translucent fills and borders from it. Keep semantic success, warning, error and status colors on explicit tokens. Treat `mix-blend-mode` as an art-directed exception for controlled backdrops, not as the component-system default. The recipe is in [surfaces.md](references/surfaces.md#adaptive-chips-on-variable-surfaces).
## Outline images with a neutral edge
When content images need a consistent edge, use the project's image-outline token. Without one, start with a `1px` outline inset by `1px`, at `oklch(0 0 0 / 0.1)` in light mode and `oklch(1 0 0 / 0.1)` in dark. Avoid an accidental palette near-black, tinted neutral or accent color, because the tint shows as a colored fringe on the image edge. Use a themed outline only when the project intentionally defines one. Skip transparent artwork such as logos and illustrations. The recipe is in [surfaces.md](references/surfaces.md#image-outlines).
## Hover effects only on hover-capable pointers
Put hover-only styling behind `@media (hover: hover)`. On touch, `:hover` latches after a tap and reads as a stuck selected state. Tailwind 4's `hover:` variant already compiles under that query, and Tailwind 3's does not. Where a control draws its own pressed state, set `-webkit-tap-highlight-color: transparent` so the default gray flash does not double it.
## Contain scroll inside overlays
Give scrollable dialogs, drawers, menus and side panels `overscroll-behavior: contain`, so scrolling past their end never scrolls the page behind.
## Match icon stroke to text weight
An icon's rendered stroke tracks the weight of the text beside it. Match the project's icon system; without one, start from `1.5px` at 400 up to `2.5px` at 700. Keep one coherent icon family and stroke language per surface. The table, sizing and grid rules are in [icons.md](references/icons.md).
## One SVG, recolored per state
Icons use `currentColor` and take hover, selected and disabled states from CSS color and opacity, never from separate assets. Outline is the default variant, and fill marks the active state. Under `dir="rtl"`, mirror only icons whose meaning follows reading direction. See [icons.md](references/icons.md#icons-in-rtl).
## Before you finish
| Detection | Fix |
| --- | --- |
| Padded parent and child with the same `rounded-*` or `border-radius` | Add the padding to the outer radius |
| `box-shadow: 0 0 0 1px` ring with no `border` beside it | `border: 1px solid transparent` |
| `outline-slate-*`, `outline-zinc-*` or a hex outline color on `img`, with no project image-outline token behind it | The project's token, or `outline-black/10` and `dark:outline-white/10` |
| `mix-blend-mode` used to make every chip adapt | Derive neutral chip fills from `currentColor`; keep semantic badges tokenized |
| `fill="#..."` or `stroke="#..."` inside an icon SVG | `currentColor` |
| Plain-CSS `:hover` or Tailwind 3 `hover:` outside `@media (hover: hover)` | Wrap it in the query |
| `overflow: auto` or `overflow-y-auto` on a dialog, drawer or menu with no `overscroll-behavior` | `overscroll-behavior: contain` |
## Reporting
**Verification.** Without a browser, read every state the component defines from the code, such as hover, pressed, selected, loading and empty. With one, walk each state in both themes. Report every check you could not run as `Not verified`.
A standalone review takes its severity ladder and format from [reporting.md](references/reporting.md). Use it only for a standalone review. When `studio-audit` orchestrates the review, give that skill your domain evidence and findings, and let its output format, severity scale, consolidation rules, cap and verdict take precedence.