Introduction
Overview
Mini app runtimes have their own distinct technical rules, so many features you take for granted on the web are not available as-is.
That also means you cannot directly use a utility-first CSS generator like tailwindcss to speed up development.
weapp-tailwindcss exists to bring most of Tailwind CSS back into mini app development.
It supports mainstream multi-platform mini app frameworks built on webpack and vite, and also native mini app packaging flows built on webpack or gulp.
You can integrate tailwindcss into frameworks or native development with very little friction.
Let's get started.
At its core, this project is a string escaper. It takes the class names collected by tailwindcss and the CSS output it generates, then converts them into forms that mini app runtimes can accept.
Environment requirements
[email protected]and newer requires Node.js>=22.12.0. From that version onward, Node.js 22 can load ESM from CommonJS by default.uni-app/uni-app xprojects that use HBuilderX require HBuilderX>=5.11.
Why weapp-tailwindcss?
- ✅ Handles all relevant files automatically. Using WeChat Mini Program as an example, it can process and escape not only
wxml/wxss, but alsojsandwxsoutput. - ✅ Supports native mini app development as well as frameworks such as
taro,uni-app, andmpx. - ✅ Offers multiple integration styles, including
webpack/vite/gulpplugins and a directnodejs api. - ✅ Comes with a rich ecosystem and ready-to-run templates, so you can reuse existing
tailwindcsstooling to build mini apps. - ✅ Uses efficient parsing and caching for fast hot updates.
- ✅ Stays close to the
tailwindcssmental model and works well with IntelliSense.
Quick start 🚀
👉 Install dependencies
The current docs target tailwindcss@4 with the latest weapp-tailwindcss.
For runnable integrations, browse the maintained examples in the project repository.