R
R
Rostislav Sergeevich2017-09-19 16:44:02
css
Rostislav Sergeevich, 2017-09-19 16:44:02

How to create animation with sass?

Greetings.
In css we create animation like this:

@keyframes name {
  0% {

  }
  100% {

  }
}

Как делать это через sass?

ЗЫ: Гуглил и читал документацию. Ничего не нашёл

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Ma98Thor, 2017-10-14
@JustSneaker

@keyframes name
  @for $i from 0 through 10 
    #{$i*10%}
      css свойства (могут зависеть от $i)

Here is a working example. The object with id=phone will wiggle on hover.
#phone:hover 
  $a: 1
  animation: swinging 7s ease-in-out 0s infinite
  @keyframes swinging
    @for $i from 0 through 5 
      $a: -$a
      #{$i*5%}
        transform: rotate(#{(25-$i*$i)*$a+deg})

R
Ramazanches, 2021-02-07
@Ramazanches

.selector
width: 0
animation: name 1s ease
@keyframes name
from
width: 0
to
width 100vw
Don't forget to 'Tab' correctly, sass is picky about padding

D
Dmitry Khristoev, 2017-09-19
@Haoss

@keyframes name
0%
100%
not?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question