Jump to content
Search Community

How to select ::after pseudo class

Sabz test
Moderator Tag

Go to solution Solved by Sabz,

Recommended Posts

Hello guys, 

I'm currently working on an exciting image reveal animation for my Next.js and GSAP project. To achieve this, I've utilized the CSSRulePlugin to target the ::after class. Surprisingly, the animation works flawlessly on my localhost:3000, but unfortunately, I encountered an error after deploying the project.

 

For your convenience, I've created a Codepen that demonstrates the exact implementation I've used. Additionally, I've attached some screenshots showcasing the encountered errors.

 

I have this warning on my localhost:3000 (but everything is working fine on localhost):

image.thumb.png.e2436dfcadaf08c198e268f94498b0d1.png

 

And here are the output and errors after the deployment:

(output)
image.png.b450d737e3863168195d94ccd1c63b1c.png

(browser console)

image.thumb.png.629742eada02447dcb0ba5d2dfbc9600.png

 

I've also done some research, but I couldn't find any specific Next.js support addressing this particular issue. If anyone has encountered a similar problem or has any insights into resolving it, I would greatly appreciate your input.

 

Thank you all for your time and assistance.

Best regards,
Sabbir

See the Pen dyQRxPb by sabbirzzaman (@sabbirzzaman) on CodePen

Link to comment
Share on other sites

Hi @Rodrigo, Thanks for sharing the docs. But I've already read that doc before. It says CSSRulePlugin has been deprecated in favor of using CSS variables. But I'm not trying to select a CSS variable. I need to select a pseudo-class (::after). And I'm using the exactly same thing according to the documentation. 

I'm also using the same method:
image.thumb.png.db4c1367e76c39784f00076bbec03ab5.png

 

But I'm getting those errors that I mentioned earlier. Could you please help me identify the issue? Thanks.

Link to comment
Share on other sites

  • Solution

***Update***

 

Hello guys, I've found another solution. I'm using clip-path instead of using pseudo-classes. That's I don't need to use the CSSRulePlugin anymore. And my problem is now solved. 

  • Like 2
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...