Q
Q
quiplunar2020-05-31 21:13:26
Angular
quiplunar, 2020-05-31 21:13:26

Angular scss not working $self due to shadowcsshost?

5ed65e9688fc9340372130.png

And so the problem is that in $selfgets :host .ui-input, since & will contain :host .ui-button.

Angular forbids using this construct:

:host {
     // code
     :host {
          // code
     }
}


And in css adds shadowcsshost:

5ed65f45e95c8991726933.png

Answer the question

In order to leave comments, you need to log in

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

The solution to this problem is a simple scss function:

$self: self(&);

@function self($self) {
  @return selector-replace($self, ':host', '*');
}

We simply replace :host with *

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question