Systematically fixes Tailwind classes, layout inconsistencies, and UI patterns for canonical, readable styling without redesigning. Use when lint warns on Tailwind, duplicated or conflicting classes appear, layout feels inconsistent across screens, or JSX class strings are messy.
Clean and standardize UI code: canonical Tailwind, no duplicate/conflicting utilities, predictable layout, readable JSX. Refactor only—not a visual redesign.
top-0 bottom-0 → inset-y-0className stringsPrefer shorthand utilities; do not mix shorthand with redundant explicit edges.
| Instead of | Use |
|---|---|
top-0 bottom-0 | inset-y-0 |
left-0 right-0 | inset-x-0 |
top-0 right-0 bottom-0 left-0 |
inset-0 |
Apply the same idea for other Tailwind shorthands when they are equivalent and unambiguous.
w-full w-full).p-2 p-4 → one padding).Order className roughly:
flex, grid, position, inset-*)w-*, h-*, max-w-*, …)p-*, m-*, gap-*)shadow-*, opacity-*, …)Keep existing project conventions if a file or component already follows a stable order—do not fight working patterns for marginal gain.
w-full max-w-full when one is enough.min-h-screen, h-screen, etc.) over arbitrary values when equivalent.h-full, min-h-*, and fixed h-* without a clear reason; simplify when behavior is unchanged.Remove redundant combinations, for example:
w-full + max-w-full when redundantabsolute + full inset-* + duplicate width/heightIf the same long class string repeats in multiple places, consider a small shared component or a single utility class—only when extraction is clearly simpler than duplication. Do not over-engineer.
If equivalence or side effects are ambiguous, do not guess—leave the original classes or ask.
px with Tailwind tokens when equivalent.sm:, md:, lg:) to match nearby components.className usage and layout patterns