transpile scss to css added root class?

I am trying to transpile this scss to css input .abc{ .slider { $root: &; … Read more transpile scss to css added root class?

I am trying to transpile this scss to css

input

.abc{
  .slider {
    $root: &;
    &--fade {
      > #{$root}__track {
        > #{$root}__list {
          > #{$root}__slide {
            .rh08w5 {
              opacity: 0;
              h2 {
                opacity: 0;
              }
             
           
            }
          
          }
        }
      }
    }
  }
}

output

.abc .slider--fade > .abc .slider__track > .abc .slider__list > .abc .slider__slide .rh08w5 {
  opacity: 0;
}
.abc .slider--fade > .abc .slider__track > .abc .slider__list > .abc .slider__slide .rh08w5 h2 {
  opacity: 0;
}

expected output

.abc .slider--fade > .slider__track > .slider__list > .slider__slide .rh08w5 {
  opacity: 0;
}
.abc .slider--fade > .slider__track > .slider__list > .slider__slide .rh08w5 h2 {
  opacity: 0;
}

In my output .abc class added in all item . I want it should add only on top element ?

Source: JavaSript – Stack Overflow


Categories: NewsTags: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *