I am working with the new CSS3 animation properties and the painful part of it is that for each color effect, you have to have a full set of
@keyframes greenEffect {
.effect(@green)
}
@-moz-keyframes greenEffect /* Firefox */ {
.effect(@green)
}
@-webkit-keyframes greenEffect /* Safari and Chrome */ {
.effect(@green)
}
Now when I have 16 colors or so, I really don't want to copy + paste 16 blocks of code. 16 lines are bad enough.
To reduce workload, I need to find a way to do selector interpolation with @rule
I found out that selector interpolation syntax is @{VARIABLE-NAME} after 1.3.1, but it throws a compile error when used together with @keyframes, or @-moz-keyframes
I am very new to LESS so I tried something like
.xBrowserEffect (@color, @className){
@keyframes @{className} {
.effect(@color)
}
@-moz-keyframes @{className} /* Firefox */ {
.effect(@color)
}
@-webkit-keyframes @{className} /* Safari and Chrome */ {
.effect(@color)
}
}
With this I want to be able to execute
.greenEffect{
.xBrowserEffect (@green, greenEffect)
}
and LESS will generate all that 3 select propert blocks
I wonder if anyone knows a different approach to get this done. Thank you in advance.
I am using lessc 1.3.3 at the moment, but any solutions for less 1.4.0 is welcome.