Skip to content

Stop pinning transform:none on blocks after their entrance animation - #256

Open
amjadr360 wants to merge 1 commit into
mainfrom
fix/animation-cleanup-clobbers-custom-transforms
Open

Stop pinning transform:none on blocks after their entrance animation#256
amjadr360 wants to merge 1 commit into
mainfrom
fix/animation-cleanup-clobbers-custom-transforms

Conversation

@amjadr360

@amjadr360 amjadr360 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

When a block finished its entrance animation, the theme locked it flat. Any tilt, skew, or rotation added afterwards — including one the AI Agent adds for you — looked right while you were editing and then vanished on the next page load. The lock turned out to be unnecessary, so it's gone. Entrance animations behave exactly as before.

  • Custom opacity and custom animations on an animated block are still overridden. Kevin flagged that as a separate follow-up (wrapping the selector in :where()), deliberately not in this PR.

How to test

On a site with animations turned on, give an animated block a rotation through custom CSS — in the block editor's Additional CSS panel, or by asking the Agent to tilt a heading — then reload the page. The tilt should still be there, and the block should still fade in on scroll.

Closes extendify/company-product#2278

The post-animation cleanup rule (.ext-animate[data-ext-animated]) pinned
transform: none !important forever. Its specificity (0,2,0) beats the
(0,1,0) that WP core gives block custom CSS — core wraps style.css in
:root :where(.wp-custom-css-<hash>) — so any user transform (a tilted
heading via the Agent's custom-CSS escape hatch, or the block editor's
Additional CSS panel) previews fine, saves fine, then silently renders
untransformed on every reload of an animated block.

The transform line was redundant: animation: none !important already
removes the keyframe-supplied transforms, and the interactivity JS's
inline transform reset (setType('none') path) is non-important, so it
still yields to a user's !important custom rule. opacity stays pinned
because .ext-animate's opacity: 0 base would otherwise re-hide the
element.

Found live-testing the extendify-sdk schema-based block-updating branch:
"tilt this heading slightly" on a launched site (entrance animations on
by default) lost the tilt after reload.
@amjadr360
amjadr360 force-pushed the fix/animation-cleanup-clobbers-custom-transforms branch from f99ea83 to 4f357ec Compare August 3, 2026 07:03
@amjadr360
amjadr360 marked this pull request as ready for review August 3, 2026 07:04
@kossmann
kossmann requested a review from KevinBatdorf August 4, 2026 18:21
@KevinBatdorf

Copy link
Copy Markdown
Member

Ideally we would be able to remove all of these. This is fine for now but we need to refactor this to do animations and leave the dom in a clean state after

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.

2 participants