I
I
ivankalachikov862016-05-18 07:43:31
Less
ivankalachikov86, 2016-05-18 07:43:31

How to implement less loop for sprite mixins?

The layout has a block with brands, pictures of brands in a sprite. The sprite generator generated mixins for less, so as not to write a separate style for each, I'm trying to do it through a cycle on less, the code is like this:

@amount: 9;

.myLoop (@index) when (@index < @amount) {
  .brands__item@{index} {   // Вот здесь имя селектора генерируется верно
    .sprite();
    [email protected]{index};  //а здесь, ругается unrecognized input
  }
  .myLoop(@index + 1);
}

.myLoop (1);

Apparently, variable interpolation does not work. Can't figure out how to fix it? Maybe add parentheses?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question