Replies: 1 comment 3 replies
-
Maybe this can be solved with css custom properties. I have not tried it, but maybe something like this: js code: const style = useSpring({
to: {
transform: `translate(0px, var(--animation-vertical-offset))`,
},
}) styles :root {
--animation-vertical-offset: 30px;
}
@media screen and (min-width: 768px) {
:root {
--animation-vertical-offset: 50px;
}
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to have different animations on mobile and desktop. It's possible to get it to work with a media query hook but that won't work on a project with server-side-rendering. So I am looking for a solution to use media-queries inside the spring props. Anyone can help me?
Sol 1 (works but not good for SSR)
Sol 2 (would be nice to get something like this to work)
Beta Was this translation helpful? Give feedback.
All reactions