README_en.md

June 24, 2026 · View on GitHub

weapp-tailwindcss logo

weapp-tailwindcss

Bring Tailwind CSS to mini programs and multi-platform apps.

简体中文 | English

GitHub stars npm downloads license CI codecov Ask DeepWiki

What It Is

weapp-tailwindcss adapts Tailwind CSS for mini program ecosystems. It transforms Tailwind-generated selectors, utility classes, and selected CSS capabilities into forms that mini programs and multi-platform frameworks can consume more reliably.

It is designed for:

  • Using Tailwind CSS in WeChat, Alipay, Douyin, and other mini program environments.
  • Sharing atomic CSS conventions across uni-app / uni-app x, Taro, Mpx, native mini programs, weapp-vite, and related stacks.
  • Handling mini program class escaping, selector compatibility, rpx arbitrary values, CSS fallbacks, and H5/Web output differences in Tailwind CSS v4 projects.
  • Building multi-platform apps that target mini programs, H5/Web, and App WebViews.

Current Support

AreaSupport
Tailwind CSSTailwind CSS v4
Build toolsVite, Webpack 5, Rspack, Rollup, Rolldown, Gulp, and Node API
Frameworksuni-app / uni-app x, Taro, Mpx, native mini programs, weapp-vite, and related integrations
Output targetsMini programs, H5/Web, App WebView, and related platform differences
Runtime ecosystemmerge, variants, cva, runtime, typography, theme-transition, ui, and related packages
Node.jsNode.js ^20.19.0 or >=22.12.0

Documentation

Core Packages

PackagePurpose
weapp-tailwindcssCore transform and bundler integration entry
@weapp-tailwindcss/postcssCSS AST processing, selector compatibility, and platform fallbacks
@weapp-tailwindcss/postcss-calcSafe reduction for calc() expressions
@weapp-tailwindcss/resetReset stylesheet assets for mini program frameworks
tailwindcss-configTailwind CSS config loading
tailwindcss-injectorTailwind directive injection and WXML dependency tracking
weapp-style-injectorStyle entry injection for mini program build artifacts

Runtime And UI Ecosystem

PackagePurpose
@weapp-tailwindcss/runtimeShared runtime layer for escape/unescape, caching, and rpx transforms
@weapp-tailwindcss/mergeMini program runtime wrapper for Tailwind Merge v3
@weapp-tailwindcss/variantsMini program runtime wrapper for tailwind-variants
@weapp-tailwindcss/cvaMini program runtime wrapper for class-variance-authority
@weapp-tailwindcss/typographyMini program adapted version of Tailwind Typography
theme-transitionTheme transition runtime and Tailwind plugin
@weapp-tailwindcss/uiAtomic UI runtime layer for mini programs

Each package now uses Chinese as its default README.md and provides an English README.en.md.

AI Skill

If you want AI to integrate weapp-tailwindcss in an application project using current best practices, install the official Skill:

npx skills add sonofmagic/skills --skill weapp-tailwindcss

It is useful for:

  • Setting up uni-app / uni-app x, Taro, or native mini program projects.
  • Choosing the right Tailwind CSS v4 configuration path.
  • Troubleshooting missing classes, rpx arbitrary values, JS string classes, and space-x/space-y behavior.
  • Producing integration steps with validation and rollback guidance.

Read more in the Skill documentation.

Contributing

Issues and pull requests are welcome:

  • Report reproducible problems.
  • Improve framework examples or documentation.
  • Improve transforms, compatibility behavior, runtime packages, or test coverage.

Before contributing, read the repository AGENTS.md and the closest AGENTS.md under the target directory.

License

MIT

Star History

Star History Chart