Tiven Wang
Wang Tiven June 30, 2019
425 favorite favorites
bookmark bookmark
share share

https://ultimatecourses.com/blog/emulated-native-shadow-dom-angular-2-view-encapsulation#Global_CSS

Problem

在 Angular 应用程序开发中会遇到怎么设置组件样式的问题, 我想在某个组件中设置另外某个组件的样式, 而且不像要此样式对其他组件中的此组件有影响, 应该怎么设置 CSS 样式呐?

Solution

Angular can bundle component styles with components, enabling a more modular design than regular stylesheets.

什么是 a more modular design ?

CSS Modular Design

styling modularity feature

:host

:host-context

/deep/

View encapsulation

  • ShadowDom
  • Native
  • Emulated
  • None

https://angular.io/guide/styleguide

References

Similar Posts

Comments

Back to Top