This skill helps users quickly implement `weapp-tailwindcss` in business projects, ensuring stable multi-platform configuration and deployment. It is aimed at project users rather than developers within the repository.
$ npx skills add https://github.com/sonofmagic/skills --skill weapp-tailwindcssweapp-tailwindcss is a skill that enables developers to quickly integrate Tailwind CSS into WeChat mini-app (WeApp) business projects. It provides stable, tested configuration and deployment practices across multiple platforms, eliminating the need to manually configure Tailwind for WeApp environments. The skill is designed for project teams and business applications rather than framework developers, offering ready-to-use setup that handles multi-platform compatibility. Install it via npx skills add sonofmagic/skills --skill weapp-tailwindcss to accelerate WeApp development with utility-first CSS styling.
Install this skill using the command provided.
Quickly enable `tailwindcss + weapp-tailwindcss` in new projects.
Migrate older projects (e.g., `uni-app`, `taro`) to integrate with `weapp-tailwindcss`.
Set up multi-platform collaboration with configuration for mini-programs and `H5`/`App`.
Troubleshoot issues like styles not applying or unexpected `rpx` values.
$ npx skills add https://github.com/sonofmagic/skills --skill weapp-tailwindcssgit clone https://github.com/sonofmagic/skillsCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Help me implement `weapp-tailwindcss` in my [COMPANY] [INDUSTRY] project. Provide step-by-step instructions to configure Tailwind CSS for WeChat Mini Programs, including setup, customization, and deployment. Use [DATA] as placeholder for project-specific details.
## WeApp-TailwindCSS Implementation Guide for [COMPANY]'s E-Commerce Mini Program
### 1. Project Setup
- Initialize your WeChat Mini Program project (if not already done):
```bash
npm init miniapp
cd your-project
```
- Install `weapp-tailwindcss` and Tailwind CSS:
```bash
npm install weapp-tailwindcss tailwindcss postcss autoprefixer --save-dev
```
### 2. Configuration Files
Create/modify these files in your project root:
**`tailwind.config.js`**
```javascript
module.exports = {
content: ['./**/*.{wxml,wxss,js,ts}'],
theme: {
extend: {
colors: {
primary: '#FF6B6B',
},
},
},
plugins: [],
}
```
**`postcss.config.js`**
```javascript
module.exports = {
plugins: {
'weapp-tailwindcss': {},
autoprefixer: {},
},
}
```
### 3. Build Process
- Add this script to your `package.json`:
```json
"scripts": {
"build:css": "tailwindcss -i ./src/styles/app.css -o ./dist/app.wxss --watch"
}
```
- Run the build:
```bash
npm run build:css
```
### 4. Usage in Mini Program
- Import the generated `.wxss` file in your pages:
```wxml
<view class="bg-primary text-white p-4">Welcome to [COMPANY]!</view>
```
### 5. Testing & Deployment
- Test the styling in WeChat Developer Tools
- Deploy using:
```bash
npm run build
miniprogram-ci upload --project-path ./dist --upload-desc "[DATA]" --version "1.0.0"
```
**Note:** Ensure your WeChat Mini Program appid is properly configured in `project.config.json`.Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan