Vue CLI Plugin for Tailwind CSS

3.0.0 · active · verified Sun Apr 19

vue-cli-plugin-tailwind is a specialized plugin designed to simplify the integration of Tailwind CSS into projects managed by Vue CLI. Its current stable release is v3.0.0, which mandates compatibility with Vue CLI v5.0 or newer and provides support for Tailwind CSS v3.0. The plugin automates the setup of Tailwind CSS, including necessary PostCSS configurations, and offers an interactive prompt to generate a `tailwind.config.js` file with minimal, full, or no predefined content. This significantly reduces manual setup effort and potential configuration errors, allowing developers to quickly adopt Tailwind's utility-first approach within their Vue.js applications. The project's release cadence generally aligns with major updates to both Vue CLI and Tailwind CSS, ensuring ongoing compatibility and feature support.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to install `vue-cli-plugin-tailwind` into a new or existing Vue CLI project, including prerequisite `vue-cli` versions and interactive configuration options for `tailwind.config.js`.

# 1. Ensure Vue CLI v5.0+ is installed globally
# npm install -g @vue/cli@next

# 2. Create a new Vue CLI project (if you don't have one)
# vue create my-vue-tailwind-app
# cd my-vue-tailwind-app

# 3. Add the Tailwind CSS plugin to your project
vue add tailwind

# During the interactive prompt, you will be asked to choose
# how your tailwind.config.js file should be generated:
# - 'minimal' (default): A basic config file.
# - 'full': The complete default Tailwind CSS configuration.
# - 'none': If you plan to provide your own config file.

# 4. Verify your postcss.config.js (should be automatically configured):
// module.exports = {
//   plugins: {
//     tailwindcss: {},
//     autoprefixer: {},
//   },
// };

# 5. Start your development server
# npm run serve

# You can now start using Tailwind CSS classes in your Vue components.

view raw JSON →