Fortael Fortael - 17 days ago 7
Sass (Sass) Question

SASS look up like in stylus

It is even possible with parent ampersand -

&
?

Something like this

.block
&--mod
{???}__elem
color: red


To this

.block--mod .block__elem {
color: red; }

Answer

There isn't something like Partial Reference in SASS but you can do this:

.block
  $root:&
  @at-root
    #{$root}--mod
      #{$root}__elem
        color: red

It's not as clean as you can archieve in Stylus but works.

Comments