I want to change the text of a button when it’s on hover, but I didn’t find a way to change it natively and I also don’t know how to do it just with CSS, the only solution I found was using an HTML widget with code generated by ChatGPT:
Yes, you’re right, I did it this way and it worked, the only problem is that I couldn’t apply transitions to make it smoother, would you know how to solve this?
One method I can think of would be to create a custom button and have 2 text elements inside.
Add a new hover state on the button wrapper with Apply to children enabled.
Have 1 text with conditional rendering On and the other Off.
3.On hover of the button, on each of these element, change the display.
That should take care of display the right text.
For the animation, you can add a small CSS animation snippet (or use the Animation Beta feature):
<style>
/** Put that in an HTML Embed to preview it in the Editor**/
@keyframes button-animation {
from {
opacity: 0
}
}
</style>
Apply that to the 2 text elements by inserting the following CSS property to their custom CSS: animation: 1s linear button-animation;