Repository navigation
v1.13.0
Wrapping cva/tv/classed behind a shared design-system package — re-exporting them under your
own names — is a common monorepo pattern, but a wrapper registered in callees was extracted with
the generic cn-style walk, so the classes nested in its slots/variants config went unseen and no
rule fired. This release adds settings.tailwindcss.calleeExtractors, which maps a custom callee to
the structured extractor it follows so it gets the same deep extraction as the built-in helper —
without renaming imports at every call site
(#155, reported by @azu).
It also fixes enforce-canonical under variants: the autofix that turned bg-white/[.08] into
bg-white/8 never applied to dark:bg-white/[.08] or hover:z-[10], and arbitrary variants like
data-[open]: were never canonicalized at all
(#156, reported by @Nayeem-XTREME).
Features
settings.tailwindcss.calleeExtractorsroutes a custom callee through a known structured
extractor. Map a wrapper name totv,cva,classed, orflat(e.g.
{ "defineStyles": "tv" }) and it is extracted like the helper it wraps, across all 24 rules.
Mapped names are auto-registered as callees (no need to list them incalleestoo); an
unrecognized value is skipped rather than throwing,exclude.calleesstill wins, and the reserved
namestv/cva/classedalways use their built-in extractor and can't be remapped.
Bug fixes
enforce-canonicalnow rewrites arbitrary values under a variant.bg-white/[.08]→
bg-white/8was reported, butdark:bg-white/[.08],hover:z-[10]orsm:dark:bg-white/[.08]
were silently left alone. The value-preserving check (#78) compared the emitted CSS after cutting
it between the first{and the last}, which drops the selector only when it comes first; a
variant wraps the rule in an at-rule (@media (hover: hover) { .hover\:z-\[10\]:hover { … } }),
so the escaped class name — different by construction — stayed in the comparison and every
variant-prefixed rewrite read as unsafe. The check now neutralizes only the class's own name and
compares everything else, so #78's guarantee is unchanged:dark:text-[#fff]is still not
rewritten todark:text-white, which reads a theme variable
(#156, reported by @Nayeem-XTREME).enforce-canonicalcanonicalizes arbitrary variants. Tailwind rewritesdata-[open]:→
data-open:,aria-[checked=true]:→aria-checked:andmin-[40rem]:→sm:, but these
classes never reached the design system: only the utility was checked for brackets, and the
precomputed map knows utilities, not variants. They are now asked too, under the same
value-preserving check — a variant rewrite that changes the selector (has-[:checked]:→
has-checked:,[&>*]:→*:) is left as written.
Documentation
rootFontSizeno longer claimsenforce-canonicalrewritesp-[2px]→p-0.5. It hasn't
since #78 (the CSS isn't byte-identical); the README and the settings page now say what the
setting actually feeds:prefer-scale-token's px-to-scale comparison and Tailwind's
canonicalizer.