John
John

Reputation: 2163

Angular 2 share the same css file across the module

It's possible to share the same css file across the same angular 2 module?

I know that I can set View Encapsulation Emulated to inherited parent component css but I want to share the same style across one particular module of my app.

This is my app structure:

Upvotes: 5

Views: 5785

Answers (1)

Robin Dijkhof
Robin Dijkhof

Reputation: 19288

Yes you can. Simply create a file, shared.scss for example. Now you can import it in you components style: @import './styles/shared.scss'; You could also add it to your styleUrls in your component.

Upvotes: 10

Related Questions