v0.2.3 · Scoped Styles & New Parser (BREAKING)
v0.2.3 · Scoped Styles & New Parser (BREAKING)
TL;DR
🔒 Element-scoped UI variants · ⚡ 4× faster compile · 🎯 String-only keys · 🛑 Breaking change notice & migration guide below.
✨ Highlights
| Feature | What it means |
|---|---|
| Scoped styles | Attach ref={setter.ref} and data-ui="key:value" is set only on that element; descendants style with key-value:* Tailwind classes. |
| String-only UI keys | Both stateKey and initial value must be kebab-case strings. Guarantees deterministic CSS. |
| Tailwind-style variant discovery | Parser resolves each stateKey and scans your codebase for key-value:utility classes—auto-registers custom variants, no plugin boilerplate. |
| New parser stack | quick-glob + quick-lru + full Babel traversal → 4× faster on a 10 k-LOC repo. |
| Zero-runtime CSS | Generates static selectors like .profile-card:theme-dark:bg-black via PostCSS 8. |
| TypeScript migration (phase 1) | Core rewritten in .ts (helpers stay .cts). |
🧩 Internal
-
Swapped
fast-glob→quick-globwith.gitignoreawareness.
📦 Install
# cli auto set upnpx create-zero-ui
npm
npm i @react-zero-ui/core
🗣 Feedback
Scoped styles are still fresh—file issues, tag v0.2 in the title, and include a repro. Let’s break it now, not in prod.