Jump to content
Search Community

css variables + gsap

ghost666 test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

hi !

i have in css:

:root{
	--widthcol:calc(97vw / 4 + 0.3rem);
	--widthcolnull:0;
}


for the animation I'm trying to use

TweenMax.to('.co1' , 0.5, {"--widthcolnull":"--widthcol", delay:1});

this not working...

 

where i`m wrong?

 

thx for the answer

Link to comment
Share on other sites

Sorry, but I'm not following what you are trying to do. Are you trying to animate one css var based on the value of another css var?

 

It would really help if you could put together a very basic codepen that shows how your elements are set up and how you expect them to animate. 

It doesn't have to be fancy, just the bare minimum of code to illustrate the issue.

 

It would be of even greater help to see how you would do this in CSS even without animation... just so we have an idea of the end result you are trying to achieve (and if its even possible).

 

Thanks!


ps. In case you haven't seen it, this article shows how GSAP handles css var tweening: https://greensock.com/css-variables

  • Like 4
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...