Skip to content

Transform is not updated on scroll #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kizu opened this issue Sep 12, 2023 · 1 comment
Open

Transform is not updated on scroll #27

kizu opened this issue Sep 12, 2023 · 1 comment
Labels
bug Something isn't working P2 P2 – Want

Comments

@kizu
Copy link

kizu commented Sep 12, 2023

Enabling scrolling on the example for the https://kizu.dev/position-driven-styles/#distributing-anything-property, then selecting an item and scrolling the container results in the element's transform change not being reflected on the minimap.

ezgif.com-resize.4.mov
@bramus bramus added bug Something isn't working P2 P2 – Want labels Feb 6, 2025
@bramus
Copy link
Owner

bramus commented Feb 6, 2025

While transforms do typically get updated – e.g. inspect body > header > img on https://scroll-driven-animations.style/ – the problem here is that the scroll-driven animation updates custom props which are used in a regular transform that is applied to the element.

The way the extension currently works it to copy over only the animation onto the animated element in the minimap.

What could work here is to try and figure out which declarations on the animated element are using those custom properties and copy them over. However, that is not possible right now because w3c/csswg-drafts#10002 does not exist yet.

Another way around this is to constantly do a new getComputedStyle() when the scroll position changes, but that would be expensive to do.

Open to further ideas/suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 P2 – Want
Projects
None yet
Development

No branches or pull requests

2 participants