Animation support on pseudo-classes/elements?

I was wondering if you can actually animate pseudo-classes/elements because I was trying to animate the following .loading-screen::before loading screen being a section with a width of 100% and height of 100vh and the ::before having a content of “” top of 0 left of 0 width of 50% and height of 100% with a position of absolute and background of a blueish color and z-index of -1. I tried to create a timeline with the trigger selector being my loading-screen and added a to animation with a selector of .loading-screen::before and applying my animation object to it but nothing happens.

Hi :raising_hand_man:t2: GSAP cannot animate pseudo elements out of the box. We need an additional plugin here called “CSSRulePlugin”: CSSRulePlugin - Plugins - GreenSock

This plugin is not implemented yet in Bricksforge, but the implementation will follow.

I actually managed to find a work around for now by instead animating a css variable that I applied to the property of the pseudo element I wanted to animate.


any update here? i also need to animate my pseudo-elements :slight_smile:

The CSSRule plugin has been deprecated from GSAP with the recommendation to use CSS Variables instead. What do you think?

1 Like

Hello I saw this video where he animates the pseydo element via a variable using motion page. How can we make this work in bricks forge? see from 6 30s and after.

thank you

Did you find a solution? I’m at the same point :wink: in motion page pretty easy, in bricksforge I have no clue :smiley:

I would also like to know! Any input Daniele?

Define css variable and update the variable instead of pseudoelement

1 Like

Thats the correct way :+1: