Skip to Content
v1 is on npm — atomic classes for Tailwind CSS
Preserve & runtime

Preserve & runtime

What is left untouched

The Rust (WASM) engine only atomicizes utility rules. These stay as they are:

  • @theme
  • :root
  • preflight
  • @keyframes
  • nested at-rules (@media, @supports, @container)

The rest of each selector is kept: ._hash:hover, space-y-* combinators, the @media of sm:. Hover and breakpoints survive.

twIgnore

Wrap strings that must not be rewritten:

import {twIgnore} from "tailwindcss-atomic/runtime"; <div className={twIgnore("flex hidden")} />

Add extra names via preserveFunctions if your codebase uses another helper.

Runtime cn / Tailwind Merge

If you use tailwind-merge at runtime, hashed classes no longer look like Tailwind utilities. Use the runtime helpers from tailwindcss-atomic/runtime so merge still sees the original tokens when needed, or merge before rewrite (build time).

Most apps do not need a runtime: rewrite happens at build time. Reach for runtime when class strings are built after the bundle has already been transformed.

Last updated on