Skip to content

docs(rules): name translate and scale in a transition, never transform - #881

Merged
isaque-bock-azion merged 4 commits into
mainfrom
docs/transition-property-names
Aug 13, 2026
Merged

docs(rules): name translate and scale in a transition, never transform#881
isaque-bock-azion merged 4 commits into
mainfrom
docs/transition-property-names

Conversation

@gabriel-lisboa-azion

Copy link
Copy Markdown
Collaborator

What

Tailwind v4 does not compile translate-* / scale-* to the transform property — it compiles them to the standalone translate and scale properties. So transition-[transform,opacity] names a property those utilities never set, and animates nothing.

This fails in the worst possible way: the class compiles, the utility is emitted, vue-tsc and ESLint pass, the element ends up in the right place — and no motion is ever interpolated. Nothing in the toolchain can catch it.

Why now

Two components were shipping this exact bug, and finding it took measuring frames rather than watching the screen. The rule adds the two sibling traps in the same family, both equally silent:

  • an inline style="transition: …" beats every transition-* class, so a component that sets one discards any transition a consumer puts on that element;
  • re-inserting a keyed node discards its pending transition — measured at 8 interpolated frames when the item keeps its position, 0 when it moves.

It closes with the method: verify motion by sampling the animated property across requestAnimationFrame and asserting there are interpolated frames. A snap and a 150ms ease are indistinguishable by eye in review.

Scope

Shared rules ship separately from code (.claude/rules/git-workflow.md). This is the rule alone; the two component fixes that motivated it follow in their own PRs and cite it.

Tailwind v4 compiles translate-*/scale-* to the standalone translate and
scale properties, so transition-[transform] animates nothing and fails
silently. Adds the two sibling traps in the same family: an inline
style="transition" beats every class, and re-inserting a keyed node
discards its pending transition.
@isaque-bock-azion
isaque-bock-azion merged commit 3b9cea0 into main Aug 13, 2026
17 checks passed
@isaque-bock-azion
isaque-bock-azion deleted the docs/transition-property-names branch August 13, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants