Find dead CSS before it finds you.
ReCSS is a focused TypeScript tool for CSS health analysis in real front-end repositories. It helps teams answer three painful questions fast:
- Which CSS classes are definitely used?
- Which selectors look dead and safe to review?
- Where is specificity becoming a maintenance problem?
It also gives you a conservative CSS Modules migration path instead of forcing you into an all-or-nothing rewrite.
If you have ever opened a five-year-old styles.scss file and hesitated before deleting a selector because "something somewhere probably still uses it", ReCSS is the tool for that moment.
Most CSS cleanup tools start from the production bundle. ReCSS starts from your source tree. It is designed for legacy Vue, React, and mixed codebases where the real problem is not "optimize harder", but "show me what is safe to touch".
ReCSS is conservative by design:
- Dynamic classes are treated as uncertain instead of aggressively reported as unused.
- CSS Modules are skipped instead of being guessed.
- Migration helpers rewrite common patterns, but leave ambiguous cases alone.
recss analyzeFind unused CSS and SCSS classes from Vue, React, and HTML sources.recss checkDetect specificity conflicts and!importantheavy areas before they become style wars.recss migrate --applyCopy plain style files to CSS Modules equivalents and rewrite common class references.recss-vite-pluginShow warnings during local HMR workflows.recss-vscode-extensionSurface inline diagnostics, quick fixes, and a file-level fix-all action.
pnpm add -D recss-cli
recss analyze .
recss check .
recss migrate ./src/components/button --applyWorkspace development:
pnpm install
pnpm build
pnpm lint
pnpm testrecss analyze [dir] [--framework auto|vue|react|html] [--output console|json|html] [--config <path>] [--safelist a,b] [--outfile report-path]
recss check [dir] [--framework auto|vue|react|html] [--threshold 0] [--config <path>]
recss init [dir]
recss migrate [component-dir] [--apply]recss migrate --apply is intentionally pragmatic, not magical.
Current rewrite coverage includes:
- React string literals, template literals,
clsx/cn/classnames, arrays, filter/join chains, concat chains, conditional/logical expressions, binary string concatenation, wrapper calls, and several optional-call variants. - Vue static
class, object:class, array:class, mixed static + dynamic bindings, custom style module aliases,useCssModule()accessors, and wrapper calls around supported expressions.
It will not guess through ambiguous module imports or highly dynamic expressions. That is deliberate.
- recss-cli - CLI for analysis, checking, config bootstrap, and migration.
- recss-core - core engine for parsing, analysis, reporting, and migration helpers.
- recss-vite-plugin - Vite integration for dev-time warnings.
- recss-vscode-extension - VS Code extension for diagnostics and quick actions.
This repo uses Changesets for package versioning and npm release orchestration.
pnpm changeset
pnpm version-packages
pnpm releaseRelease automation is wired through .changeset/config.json and .github/workflows/release.yml.
If ReCSS saves you time in a messy stylesheet, star the repo.