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-uiIcon transitions
Cross-fade recipes for an icon that swaps on a state change, with and without a motion library. Icon weight, color and direction live in icons.md [blocked].
Which library
Check the project's package.json. Import from "motion/react" when motion is installed, or "framer-motion" when that is. Where both exist, follow the imports the component or its nearest peers already use. Where neither is present, use the CSS cross-fade and never add a dependency just for icon transitions.
Motion
initial={false} keeps the default icon from animating in on mount. useReducedMotion() drops scale and blur under the preference, so only the opacity cross-fade runs.
CSS, both icons in the DOM
Both icons stay mounted in one grid cell, so enter and exit both animate and the larger icon sets the size. The motion-reduce: classes leave only the opacity fade under reduced motion.
Tailwind 4's scale-* utilities write the scale property, so transition-[...scale] animates them. Tailwind 3's write transform, so name transform in the transition instead.