K
K
Klein Maximus2017-08-17 10:19:07
css
Klein Maximus, 2017-08-17 10:19:07

Does Angular (2+) have scoped styles?

For example, with Vue in a single-file component, you can specify , and then the framework adds a generated attribute to the component and modifies the styles themselves somewhat, which allows you to avoid duplicating classes and styles in different components - you get something like shadow dom within the component styles.
Is it possible to do the same in Angular?
PS: I know there are BEM and similar concepts. Interested in a normal solution, not such a "crutch".

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2017-08-17
@kleinmaximus

https://angular.io/guide/component-styles
https://angular.io/guide/component-styles#view-enc...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question