soflyy / oxygen-bugs-and-features

Bug Reports & Feature Requests for Oxygen
https://oxygenbuilder.com/
314 stars 29 forks source link

Broken animation when button uses class, :hover, :active and transform scale animation #3446

Closed MaximeStarssed closed 1 year ago

MaximeStarssed commented 1 year ago

Describe the bug Broken animation when button uses a class, :hover, :active and transform scale animation

Everything is explained in the sandbox link: https://oxygen-q45lvdntmc5vl.oxygen-demo.qsandbox.org

**A link to a Sandbox site where the bug has been reproduced Here : https://oxygen-q45lvdntmc5vl.oxygen-demo.qsandbox.org

** Long description When I animate my button without using a class, everything works. The button changes size when hovered and changes size when clicked (active).

But if the code is placed in a class, and not directly on the button, the animation on click (active) bugs and freezes.

Conditions for the error to recur:

Curiously, I was also able to reproduce this bug on the primary button of the Oxygen builder home page by adding the line of code in the css ".oxy-primary-big-button:active{ transform:scale(0.95,0.95);}")" just after ".oxy-primary-big-button:hover{ transform:scale(1.04,1.04);}"

I'd be grateful for any help you can give me to correct this problem, which breaks the animations of my buttons, which inevitably need a class (I don't copy and paste the code onto all my buttons).

Thank you !

MaximeStarssed commented 1 year ago

Solution: Reproduce the button code with the value ":active" in the CSS and add the words " !important" because the ":hover" takes precedence over the ":active" when placed in a class.