Q
Q
quiplunar2020-06-02 00:15:43
Sass
quiplunar, 2020-06-02 00:15:43

Is it possible to get current class name in scss?

There is this code:

.my-best-project {
     .round-name-class {
          width: 100%;
          $self: &;

          &__hello {
               width: 100%;
          }
     }
}


In this example $self === ".my-best-project .round-name-class"
How can I get only ".round-name-class" without ".my-best-project"?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arseny, 2020-06-02
@quiplunar

https://codepen.io/i-am-studio_ru/pen/BajBrqL

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question