M
M
MashutaKlencheva2022-02-25 00:38:13
Layout
MashutaKlencheva, 2022-02-25 00:38:13

How to make an svg element smoothly change color on hover?

https://codepen.io/mashutaklencheva/pen/QWOBVqG
Smooth fading works, and color change on hover - sharp. How to make smooth and start state?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2022-02-25
@MashutaKlencheva

Set the default value of the fill property in styles:

.spoiler__button path {
  transition: fill .7s ease-in-out;
+ fill: #ECECEC;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question