W
W
WhoTheFuckIsThisGuy2019-11-29 12:17:18
Less
WhoTheFuckIsThisGuy, 2019-11-29 12:17:18

Why doesn't this code compile with less?

I use less-loader, for some reason this construction:

.transition(@rest...){
    each(@rest, {
        transition: @{value} 0.5s ease;
    });
}

It does not compile, although in the original documentation the code is almost the same, only not with the rest variable. But as I understand @rest stores a regular array of data. As I understand @{value} does not compile. Is it possible to do what I thought?
In the docs, the code is:
@selectors: blue, green, red;

each(@selectors, {
  .sel-@{value} {
    a: b;
  }
});

И он компилируется

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
display: block, 2019-11-29
@WhoTheFuckIsThisGuy

It is necessary to remove the interpolation of the value variable .

.transition(@rest...){
    each(@rest, {
        transition: @value 0.5s ease;
    });
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question