Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/simon-he95/transformtotailwindcss

online playground that transform css to tailwindcss
https://github.com/simon-he95/transformtotailwindcss

tailwindcss transform-to-tailwindcss

Last synced: 10 days ago
JSON representation

online playground that transform css to tailwindcss

Awesome Lists containing this project

README

        


to tailwindcss


English | įŽ€äŊ“中文

This library is to convert css to tailwindcss. [tailwindcss](https://tailwindcss.com/) can reuse styles better to reduce the packaging volume, which can be converted as a performance optimization method, and it can also make it easier for old projects to upgrade to tailwindcss. If you want to use [unocss](https://github.com/unocss/unocss), you can use [transformToUnocss](https://github.com/Simon-He95/transformToUnocss).

## đŸ“Ļ Install

```
npm i -g transform-to-tailwindcss
```

## đŸĻ„ cli

```
## command: totailwindcss + directory
totailwindcss playground

## revoke: totailwindcss + directory + --revert
totailwindcss payground --revert
```

## 🌈 Usage

Vite

```ts
// vite.config.ts
import { vitePluginTransformTotailwindcss } from 'transform-to-tailwindcss'
export default defineConfig({
plugins: [vitePluginTransformTotailwindcss(/* options */)],
})
```


Rollup

```ts
// rollup.config.js
import { resolve } from 'node:path'
import { rollupTransformTotailwindcss } from 'transform-to-tailwindcss'
export default {
plugins: [rollupTransformTotailwindcss(/* options */)],
}
```


Webpack

```ts
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('transform-to-tailwindcss').webpackTransformTotailwindcss({
/* options */
}),
],
}
```


Vue CLI

```ts
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('transform-to-tailwindcss').webpackTransformTotailwindcss({
/* options */
}),
],
},
}
```


Esbuild

```ts
// esbuild.config.js
import { build } from 'esbuild'
import { esbuildTransformTotailwindcss } from 'transform-to-tailwindcss'

build({
plugins: [esbuildTransformTotailwindcss(/* options */)],
})
```

## ⭐ Feature

- support css in '.html' | '.tsx' | '.vue' | '.astro' | '.svelte' to tailwindcss
- support sass less stylus convert
- support vite | rollup | webpack | vue-cli | esbuild
- vscode extension [To tailwindcss](https://github.com/Simon-He95/totailwindcss)

## 🚁 More

- [transform-to-tailwindcss-core](https://github.com/Simon-He95/transform-to-tailwindcss-core) - Provides the ability to convert css to tailwindcss on the browser side

## Before

![before](/assets/before.png)

## After

![after](/assets/after.png)

## :coffee:

[buy me a cup of coffee](https://github.com/Simon-He95/sponsor)

## License

[MIT](./license)