DEV Community

Discussion on: Angular Style Encapsulation: You're Doing It Wrong

Collapse
 
marcoslooten profile image
Marco Slooten

Thanks for your reply! Yeah, I can see the use case of style objects. I think in React this pattern is more widely used than in Angular for some reason.

You're last point, you're talking about giving a nested component different styling based on the context they're used in? We'd be using ng-deep from the parent component in most cases, but we're starting to explore global styling for that kind of use case more and more. It's just a shame to lose the encapsulation, but in a way BEM will prevent most accidental overwrites. My gripe was more with using BEM within components that don't have children and have encapsulated styles.