Q
Q
quiplunar2020-06-01 20:37:31
Sass
quiplunar, 2020-06-01 20:37:31

How to convert to text in scss?

I am using this construct:

:host {
     .ui-button {
          width: 100%;
          height: 100%;
          $self: &;

          :hover {
                    #{$self}__icon {
                              display: none;
                    }
          }
     }
}


But it doesn't work in angular, there is an addition: -shadowcsshost

But if you do this:

:host {
     .ui-button {
          width: 100%;
          height: 100%;
          $self: '.ui-button';

          :hover {
                    #{$self}__icon {
                              display: none;
                    }
          }
     }
}


That works.

And actually the question is: How to convert & to text so as not to write the class name manually?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Flying, 2020-06-01
@quiplunar

selector-parse(&), see documentation for details .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question