Blazor Style Encapsulation
· ☕ 4 min read
To explain what style encapsulation means, we will look at how Angular does it. On this screenshot an h1 style is converted to _ngcontent-lvy-c0 class during compilation, and so it does not leak out styles to other components and the app. You can declare another h1 style in another component and that will not have any effect on this component, guaranteed by Angular. Or its children, which might be even more important (so it's more than just nesting css in an HTML selector tree).