V
V
Vladimir Golub2017-08-13 01:23:38
Sass
Vladimir Golub, 2017-08-13 01:23:38

How to write a construction like .product.product_item in SCSS?

How to write a construction like .product.product_item in SCSS
I try like this, but it gives an error

.product {
  &.&_item {

  }
}

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
monochromer, 2017-08-13
@RazerVG

.product {
  $this: &;

  @at-root {
    #{$this}#{$this}_item {
      color: red;
    }
  } 
}

R
roxik, 2017-08-13
@roxik

.product {
  &.product_item {

  }
}

Z
zooks, 2017-08-13
@zooks

Much more convenient is the Sass syntax:

.product
  &.product
    &_item

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question