Taro Plugin Tailwind screenshot

Taro Plugin Tailwind

Author Avatar Theme by Pcdotfan
Updated: 28 Aug 2024
136 Stars

Taro 接入 tailwindcss 插件

Overview

The taro-plugin-tailwind is a plugin for Taro that integrates tailwindcss, supporting most mini-programs like WeChat, Alipay, and Baidu mini-programs, as well as H5. It requires Taro CLI to be upgraded to Taro 3 (version 3.5+), and the plugin version to be v1.3.0 or higher. By modifying the project configuration file and importing tailwindcss into the main CSS file, users can utilize tailwindcss throughout the project without the need for manual imports.

Features

  • Integrates TailwindCSS: Adds support for TailwindCSS in Taro projects.
  • Multi-platform Compatibility: Tested on WeChat, Alipay, and Baidu mini-programs, as well as H5.
  • Easy Configuration: Generate necessary configuration files with a single command.
  • Customizable Options: Accepts parameters such as optional PostCSS configurations for TailwindCSS.

Installation

To install and use the taro-plugin-tailwind plugin in your Taro project, follow these steps:

  1. Ensure Taro CLI is updated to Taro 3 (version 3.5+).
  2. Install taro-plugin-tailwind with a version equal to or higher than v1.3.0.
  3. Modify the project’s config/index.js file to include the plugin configuration.
  4. Generate the necessary configuration files by running taro tailwind --init.
  5. Import tailwindcss in the main CSS file of the project (e.g., style.css or main.css).

Summary

The taro-plugin-tailwind is a convenient plugin for integrating tailwindcss into Taro projects, enabling users to easily leverage the power of utility-first CSS. With support for multiple mini-program platforms and H5, along with customizable options and easy installation steps, this plugin streamlines the process of incorporating TailwindCSS styling in Taro applications.