Building HTML UI forced me to figure out how to write CSS classes that integrate deeply with Tailwind v4. I want 3 things: intellisense, tree shaking, and easy utility overrides. Here’s I make it all work 🧵
@​utility ui-badge {
:where(&) {
@​apply inline-flex items-center ...;
@​variant hover {
@​apply bg-primary/90;
}
@​variant focus-visible {
@​apply border-ring ring-ring/50;
}
}
}