I have two modules: FrontUI & AdminUI. The FrontUI is the root module and the AdminUI is lazy loaded.
In the Admin section, I need to load few .css files that are different from the FrontUI and is particular to admin section only. I tried the following -
"styles": [
"node_modules/@xyzPlugIn/base.css",
"node_modules/@xyzPlugIn/theme.css"
],
@Component({
selector: 'app-admin',
templateUrl: './admin.component.html',
styleUrls: ['../node_modules/@xyzPlugIn/base.css',
'../node_modules/@xyzPlugIn/theme.css']
})
Can different styles be loaded for two separate modules, as the client/users are different? In production environment, can these files be bundled?
P.S: The project structure I have mentioned is short for better understanding.
Thank you Jonathan Hamel.
I achieved by doing the following:
admin.component.ts
@Component({...
styleUrls: ['./admin.component.css'],
encapsulation: ViewEncapsulation.None
})
admin.component.css
@import "~@xyzPlugIn/base.css";
@import "~@xyzPlugIn/theme.css";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With