Home

Awesome

CSS to TailwindCSS converter (VS Code extension)

🔗 NPM Package

🔄 Convert your CSS to TailwindCSS considering workspace tailwind configuration in a few clicks.

VSCode extension demo

You can even convert simple JS objects!:

VSCode extension demo

Features:

Installation

Install via the Visual Studio Code Marketplace →

The extension finds the first Tailwind config file named tailwind.config.js or tailwind.config.cjs in your workspace and uses it when converting CSS. Use tailwindCSS.experimental.configFile setting to manually specify the config file(s) yourself instead.

Usage

  1. Select the CSS you want to convert to TailwindCSS
  2. Open command pallete (Mac: Shift+Cmd+P; Windows: Shift+Ctrl+P)
  3. Run "Convert CSS to TailwindCSS" command

For more convenience, you can also assign a keyboard shortcut to the "Convert CSS to TailwindCSS" command.

Extension Settings

To avoid duplicate settings, this extension uses the Tailwind CSS IntelliSense settings

cssToTailwindCss.arbitraryProperties

Default: false

Defines whether non-convertible properties should be converted as arbitrary properties.

tailwindCSS.rootFontSize

Default: 16

Root font size in pixels. Used to convert rem CSS values to their px equivalents.

tailwindCSS.experimental.configFile

Default: null

By default the extension will automatically use the first tailwind.config.js or tailwind.config.cjs file in your workspace that it can find to provide CSS to TailwindCSS converting. Use this setting to manually specify the config file(s) yourself instead.

Example:

"tailwindCSS.experimental.configFile": ".config/tailwind.config.js"

Release Notes

1.2.6

1.2.5

1.2.3

1.2.2

1.2.1

1.2.0

1.1.1

1.1.0

1.0.0