Tailwind CSS

Recast Tailwind Support

VS Code Setup

To get Tailwind CSS (opens in a new tab) intellisense working for Recast inside of VS Code (opens in a new tab), please follow the steps below:

Install Tailwind CSS IntelliSense fo VS Code

If you haven't already you will need to install the Tailwind CSS IntelliSense (opens in a new tab) VSCode extension.

Add the Recast Regex

Add the following regex to your .vscode/settings.json file at the root of your project:

{
  "tailwindCSS.experimental.classRegex": [
    ["recast\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
  ]
}

Voilà!

You should now have Tailwind CSS intellisense working inside of your Recast components.

Tailwind CSS VS Code Intellisense

Prettier Tailwind Sort Plugin

Recast will also work with other Tailwind CSS utilities including: prettier-plugin-tailwindcss (opens in a new tab). Inside your .prettierrc file you can add the following configuration:

{
  "tailwindFunctions": ["recast"]
}

More information is available here: Prettier Plugin Tailwind CSS (opens in a new tab)