How can target Only Pseoudo class with interactions

i will like to know how can I add animation to a pseudo class ::before, for example
I have a rectangle with some text in it, I created a pseudo class :: before with 100% width and height, so I created a border top and bottom of 1rem, so I’m trying to create an animation where the pseudo slides from left but when I apply it al also animates the parent, can same one help me to figure this out.



I tried targeting with a class too but same it animates all of it

I’m guessing you cannot use interactions on pseudoclasses, since javascript manipulates the DOM and pseudoclasses are not a part of it.

I think the CSS animations will help you.

Thank you, i will dig into it… thank you again