Sandro Maglione
banner
sandromaglione.bsky.social
Sandro Maglione
@sandromaglione.bsky.social
The Coding Explorer 💻・Sharing patterns to build type-safe web & mobile apps・Typescript・Effect・React・XState

Helping devs at http://typeonce.dev 🚀
Read the full details and examples in the article 👇

www.typeonce.dev/article/patt...
Patterns for composable tailwindcss styles | Typeonce
Professional training for Full-Stack software development teams
www.typeonce.dev
December 23, 2024 at 4:01 PM
👉 className instead of variants

Extract variants as `utility` and compose styles as classes instead of props
December 23, 2024 at 4:01 PM
👉 HTML custom data attributes

Define states as `data-` attributes, and then reference them easily as tailwind classes

Use the new `variant` to clean all up as well
December 23, 2024 at 4:01 PM
👉 Inline CSS variables

Define dynamic values as local/inline CSS variables, and reference them as a static tailwind classes
December 23, 2024 at 4:01 PM