better-ui
Design engineering principles for making interfaces feel polished. Use when building UI components, reviewing frontend code, implementing animations, hover states, shadows, borders, micro-interactions, enter/exit animations, or any visual detail work. Triggers on UI polish, design details, "make it feel better", "feels off", stagger animations, border radius, optical alignment, image outlines, box shadows.
Install
npx skills add https://github.com/jakubkrehel/skills --skill better-uiIcons
Icon stroke weight, sizing, state colors, variants and RTL mirroring.
Match icon stroke to text weight
The widths are rendered pixels. A 24px-grid icon drawn at 16px scales its stroke by 16/24, so stroke-width="2" paints about 1.33px. Use the library's absolute-stroke option, such as Lucide's absoluteStrokeWidth, or set vector-effect: non-scaling-stroke on the SVG's shapes.
- One library per surface. Never mix icon libraries on one toolbar. Where the library has no stroke variants, keep its native stroke and use size or color for emphasis.
- Size inline icons at
1em–1.25emof the adjacent font size, so the pair scales together.
One SVG, recolored per state
Draw every icon with currentColor and let CSS state drive the color. Strip hardcoded fills such as fill="#666" to currentColor when importing icons.
Outline default, fill active
Where an icon set offers outline and filled variants, use them as a state pair, never interchangeably:
Cross-fade the swap with the values in icon-transitions.md [blocked] only where the change is infrequent, such as a bookmark or a like. An active tab swaps instantly.
Design at render size
- Test every icon at the smallest size it renders, often
16px. It must stay recognizable there. - Prefer a simplified glyph for small contexts over scaling down detailed artwork.
- Where the set ships per-size grids such as
16,20and24, use the grid that matches the render size. A 24px drawing scaled to 16px lands off the pixel grid and renders soft. - Always SVG, never raster.
Icons in RTL
Under dir="rtl", flip icons whose meaning is tied to reading direction, and leave the rest alone:
Use one mechanism per element. Two flips on one icon can compound back to unflipped.
Analyze composite icons part by part. A badge or slash overlay may keep its position while the base glyph flips. Accessible names for icon-only buttons belong to better-accessibility.