weapp-stylex
Compile official StyleX to WeChat WXSS
Keep the official StyleX runtime and style merging APIs while build adapters emit WXSS. Supports native Page/Component, Wevu, Taro React / Vue 3, and uni-app Vue 3, currently targeting WeChat mini-apps.
Maintained by: sonofmagic and contributors
Install
ForNative and cross-platform teams using shared StyleX styles, conditional merging, and themes in WeChat mini-apps.
pnpm add weapp-stylexCurrently targets WeChat mini-apps; configure the build adapter for your framework after installation.
ENGINEERING PROOF
Compile official StyleX to WeChat WXSS
Start with a real config, command, or boundary note when deciding if this project fits your codebase.
- Runtime: import official create, attrs / props, and theme APIs from weapp-stylex.
- Build: choose the /weapp-vite, /taro, or /uni-app adapter to emit stylex.wxss.
- Scope: WeChat main packages and ordinary subpackages; watch supports complete rebuilds, without stateful HMR.
Core capabilities
- Official attrs() / props() merging
- Shared styles, defineVars(), and createTheme()
- Native, Wevu, Taro, and uni-app adapters
- WXSS output and complete watch rebuilds
Common use cases
- 01Compile StyleX in native WeChat and Wevu projects
- 02Emit WeChat WXSS from Taro React / Vue 3 and uni-app Vue 3
- 03Share styles, tokens, themes, and dynamic values across modules
Platforms
Related projects
- Current version
- v0.1.0
- Oct 9, 2026
- Weekly downloads
- Not available
- GitHub Stars
- 0
Frequently asked questions
Which platforms does weapp-stylex support?
The current scope is WeChat main packages, pages, components, and ordinary subpackages. Adapters cover native projects, Wevu, Taro React / Vue 3, and uni-app Vue 3. Independent subpackages, other platforms, Vue 2, and uni-app x are not covered yet.
How do I install and choose an adapter?
Install weapp-stylex for the official runtime at the root entry. Select weapp-stylex/weapp-vite, weapp-stylex/taro, or weapp-stylex/uni-app for your framework, then configure the supported host version and adapter using the official guide.
Future documentation path
/docs/weapp-stylex/
This path will become canonical when aggregated documentation launches.