transform-to-unocss weekly downloads statistics
By Simon-He95 (2 listings) · npm · Webpack plugins
🚀 Effortlessly transform CSS, inline styles, and preprocessors (Sass/Less/Stylus) to UnoCSS with smart conflict resolution and debug support
transform-to-unocss has 285 recorded weekly downloads on npm, an increase of 1088% over the past 30 days, ranking #2397 of 3,247 tracked listings.
About transform-to-unocss
✨ Why Transform to UnoCSS?
Transform your legacy CSS into modern, performant UnoCSS with zero configuration! This powerful tool automatically converts:
- 🎨 CSS classes → UnoCSS utilities
- 🖌️ Inline styles → Atomic classes
- 🎭 Sass/Less/Stylus → Pure UnoCSS
- ⚡ Bundle size reduction up to 70%
- 🔧 Smart conflict resolution
- 🐛 Debug mode for transparency
- 🎯 One-click rollback for safety
Perfect for modernizing legacy projects or optimizing performance. Works with Vue, React, Svelte, Astro, and more!
💡 Pro tip: If you're using Tailwind CSS, check out our sister project transformToTailwindcss.
📦 Quick Start
Global Installation
npm i -g transform-to-unocss
One-time Usage (Recommended)
npx transform-to-unocss@latest your-project-folder
⚡ CLI Usage
Transform your project
# Transform entire directory
tounocss playground
# Transform with debug output
tounocss playground --debug
# Revert changes (if needed)
tounocss playground --revert
# Show help
tounocss --help
🎯 Quick Example
Before:
<template>
<div class="container">
<h1 class="title">Hello World</h1>
<p style="color: red; font-size: 16px;">This is a paragraph</p>
</div>
</template>
<style scoped>
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
background: linear-gradient(to right, #ff6b6b, #4ecdc4);
}
.title {
font-size: 24px;
font-weight: bold;
color: #333;
text-align: center;
}
</style>
After:
<template>
<div class="max-w-6xl mx-auto p-5 bg-gradient-to-r from-red-400 to-teal-400">
<h1 class="text-6 font-bold text-gray-8 text-center">Hello World</h1>
<p class="text-red text-4">This is a paragraph</p>
</div>
</template>
✨ 70% smaller bundle size and zero runtime overhead!
🔧 Build Tool Integration
<details> <summary><strong>🔥 Vite (Recommended)</strong></summary>import { viteTransformToUnocss } from 'transform-to-unocss'
// vite.config.ts
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [
viteTransformToUnocss({
include: ['**/*.vue', '**/*.tsx', '**/*.jsx'],
exclude: ['node_modules/**'],
debug: true, // Enable debug mode
}),
],
})
</details>
<details>
<summary><strong>📦 Rollup</strong></summary>
// rollup.config.js
import { rollupTransformToUnocss } from 'transform-to-unocss'
export default {
plugins: [
rollupTransformToUnocss({
include: ['**/*.vue', '**/*.tsx', '**/*.jsx'],
debug: false,
}),
],
}
</details>
<details>
<summary><strong>⚡ Webpack</strong></summary>
// webpack.config.js
const { webpackTransformToUnocss } = require('transform-to-unocss')
module.exports = {
plugins: [
webpackTransformToUnocss({
include: ['**/*.vue', '**/*.tsx', '**/*.jsx'],
exclude: ['node_modules/**'],
}),
],
}
</details>
<details>
<summary><strong>🎯 Vue CLI</strong></summary>
// vue.config.js
const { webpackTransformToUnocss } = require('transform-to-unocss')
module.exports = {
configureWebpack: {
plugins: [
webpackTransformToUnocss({
include: ['**/*.vue'],
debug: process.env.NODE_ENV === 'development',
}),
],
},
}
</details>
<details>
<summary><strong>⚡ Esbuild</strong></summary>
// esbuild.config.js
import { build } from 'esbuild'
import { esbuildTransformToUnocss } from 'transform-to-unocss'
build({
plugins: [
esbuildTransformToUnocss({
include: ['**/*.tsx', '**/*.jsx'],
}),
],
})
</details>
� Core Features
🎯 Smart Transformation
- ✅ CSS class selectors → UnoCSS utilities
- ✅ Inline styles → Atomic class attributes
- ✅ Preprocessors (Sass/Less/Stylus) → Pure UnoCSS
- ✅ Pseudo-classes (
:hover,:focus, etc.) - ✅ Media queries → Responsive classes
- ✅ Complex selectors → Smart parsing
🔧 Developer Experience
- 🐛 Debug mode - Detailed transformation logs
- � One-click rollback - Safe change reversal
- 🎨 VS Code extension - To UnoCSS
- 📝 TypeScript support - Full type definitions
- 🚀 Zero configuration - Works out of the box
🏗️ Framework Support
- ⚡ Vue 3/2 - Full support
- ⚛️ React - JSX/TSX support
- 🎭 Svelte - Native support
- 🚀 Astro - Component support
- 📄 HTML - Pure HTML files
🎨 Advanced Usage
Programmatic API
import { transfromCode } from 'transform-to-unocss'
// Transform Vue component
const result = await transfromCode(vueCode, {
type: 'vue',
isRem: true,
debug: true,
})
// Transform React component
const result = await transfromCode(reactCode, {
type: 'tsx',
isJsx: true,
debug: false,
})
Configuration Options…
Description from the npm listing.
- transform-to-unocss
- unocss
- css-migration
- css-to-unocss
- tailwindcss
- atomic-css
- css-transform
- build-tool
- vite-plugin
- webpack-plugin
- rollup-plugin
- vue
- react
- svelte
- astro
- sass
- less
- stylus
- performance-optimization
- cli-tool
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (592)Similar npm Webpack plugins plugins
All 20 transform-to-unocss alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/transform-to-unocss. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.