Hi,
I have an unexpected behavior with ScrollTrigger.saveStyles(). (for me as newcomer)
The Codepen shows a very simplified version of my problem.
The idea:
* The animation is only attached on devices with larger screens. So I use ScrollTrigger.matchMedia().
* When the animation is active, additional styles will be overridden the CSS fallback with gsap.set(). In the Codepen example the box should be only colored red.
* On devices with smaller screens the animation should not be loaded or on viewport change destroyed.
What happend:
On large devices the boxes stay orange. If ScrollTrigger.saveStyles() is enabled, it will remove the styles from gsap.set(), when executing the gsap.to() including ScrollTrigger.
What I expect:
On large devices the boxes get red. Like if I comment out ScrollTrigger.saveStyles(). And when changing the viewport, the boxes return to their fallback state (orange).
What went wrong?
Best regards