Stylus variable interpolation not working on animation property?
I'm having a lot of trouble getting variable interpolation to work consistently in Stylus. Using the version of it currently on CodePen here, no Javascript or whatever.
The following Stylus code looks like it will animate div0 with slide0 animation, animate div1 with slide1 animation, etc. etc.
for i in (0...4)
.div{i}
width: 300px
animation: slide{i} 1s infinite //Syntax error here
@keyframes slide{i}
0%
letter-spacing: i*3px
100%
letter-spacing: 0px
... however it just gives a syntax error on the line animation:
. What doesn't make sense to me is that the same syntax works when I write it in .div{i}
and @keyframes slide{i}
, but not in animation: slide{i}
.
Here is the error CodePen is giving me, doesn't seem like what's important?
stylus:4:24
1| for i in (0...4)
2| .div{i}
3| width: 300px
4| animation: slide{i} 1s infinite
-----------------------------^
5|
6| @keyframes slide{i}
7| 0%
expected ":", got "}"
source to share