0

Hi is it possible to use mixin parameter as a part of the class name used in this mixin or do it in some other way?

.thumbs-mixin(@length) {

    &.thumbs-@length {

        .slick-track {
            width: 180px * @length - 20px;
            transform: translate3d(-50%, 0px, 0px);
            left: 50%;
        }
    }
}
DAIRAV
  • 723
  • 1
  • 9
  • 31
gidzior
  • 1,807
  • 3
  • 25
  • 38

1 Answers1

1

Use Curly braces around the variable ie. &.thumbs-@{length}

.thumbs-mixin(@length) {

  &.thumbs-@{length} {
    .slick-track {
      width: 180px * @length - 20px;
      transform: translate3d(-50%, 0px, 0px);
      left: 50%;
    }
  }
}

More info: http://lesscss.org/features/#variables-feature-variable-interpolation

Shameen
  • 2,656
  • 1
  • 14
  • 21