Skip to content

Verifier: catch classes silently dropped across declarations#4

Merged
jeffdlange merged 1 commit into
mainfrom
verifier-cross-declaration-conflicts
Jun 9, 2026
Merged

Verifier: catch classes silently dropped across declarations#4
jeffdlange merged 1 commit into
mainfrom
verifier-cross-declaration-conflicts

Conversation

@jeffdlange

Copy link
Copy Markdown
Collaborator

check_self_conflicts only looks at one declaration at a time, so a class that gets silently dropped when a base and a variant are merged together slips through. The common shape:

css "... leading-snug"                       # base
css size: :default, style: "... text-sm"     # text-sm wins, leading-snug vanishes

Tailwind font-size utilities carry a default line-height, so tailwind_merge drops leading-snug — no error, no warning, it just never reaches the DOM.

Adds a cross_declaration_conflicts check that simulates the base + axis merge for every axis combination and reports declared classes the merge silently removes. It's a warning, not an error: cross-declaration drops are often deliberate variant overrides. To keep signal high it suppresses same-family overrides (p-2p-8) and surfaces only drops where the winner is a different utility family (leading-snug dropped by text-sm) — the surprising ones.

check_self_conflicts only inspects one declaration at a time, so a class
dropped when a base and an axis rule merge together (e.g. leading-snug
overridden by a size axis's text-sm) slips through unreported.

Added: Verifier cross_declaration_conflicts check warning on classes silently dropped when separate DSL declarations merge
@jeffdlange jeffdlange marked this pull request as ready for review June 9, 2026 14:44
@jeffdlange jeffdlange merged commit e31ee94 into main Jun 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant