Why can't I style angular material stepper elements directly?

前端 未结 2 711
Happy的楠姐
Happy的楠姐 2021-02-09 15:25

Here is a code example I\'ve forked from the official angular documentation for stepper: https://stackblitz.com/edit/angular-tth817

In my fork, I\'m t

2条回答
  •  抹茶落季
    2021-02-09 15:49

    Per current Angular Material documentation, you have two other options besides the deprecated method mentioned above:

    • Add the overriding style to your global style sheet. Scope the selectors so that it only affects the specific elements you need it to.
    • Turn view encapsulation off on your component. If you do this, be sure to scope your styles appropriately, or else you may end up incidentally targeting other components elsewhere in your application.

提交回复
热议问题