Is it possible to Inject a CSS Framework for a Module and all its components in Angular2+?

62 Views Asked by At

I'm Developing an application that contains 2 Modules, one module for admin layout and another module for user layout. I'm planning to use 2 different frameworks. one for admin and another for user.

one framework that affects the other so i cant keep both in .angular-cli.json globally. So Is there any possibilities to use a framework for one module and another for another. without affecting the styles.

1

There are 1 best solutions below

2
On

In user.component.css (top level component for user.module):

@import 'my-first-framework';

In admin.component.css (top level component for admin.module):

@import 'my-second-framework';

In admin.component.ts, user.component.ts (top level components for modules)

@Component({
   encapsulation: ViewEncapsulation.none
})