0

For a situation like this:

@keyframes rotateMe {
   0% { 
     transform: rotate(0deg);
   }
  100% {
    transform: rotate(90deg);
   }
}

Stylelint flags the 0deg as not needing the unit. I know for things like 0px to leave off the px, but I'm wondering if the transform would still work without the deg on the 0.

Steve
  • 14,401
  • 35
  • 125
  • 230
  • Simple answer is yes. Units only make sense when you have >0 of them. 0px = 0deg = 0elephants, it's all just 0. – Ted Sales Apr 22 '16 at 17:25
  • 1
    As @TedSales says, yes. But animations on transforms are very prone to give problems if the 2 (or more) transforms differ even slightly. So it is always a good idea to make the as similar as possible. Since the final keyframe has deg, just put deg on the initial state just to be on the safe side. – vals Apr 22 '16 at 17:39
  • @vals that's what I was thinking. – Steve Apr 22 '16 at 17:40

0 Answers0