Reputation: 7022
How to add multiple style sheet globally in Angular 11 ?
I am trying to add multiple style sheet globally in Angular 11. I added Style sheets in angular.json
file like below.
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/assets/css/bootstrap.css",
"src/assets/css/owl.carousel.css",
"src/assets/css/owl.theme.css",
"src/assets/css/font-awesome.min.css",
"src/assets/css/animate.css",
"src/assets/css/magnific-popup.css",
"src/assets/css/settings.css",
"src/assets/css/slick.css",
"src/assets/css/icons.css",
"src/assets/css/preset.css",
"src/assets/css/theme.css",
"src/assets/css/responsive.css",
"src/assets/css/presets/color1.css"
],
"scripts": []
}
},
But it is not working.
Upvotes: 0
Views: 124
Reputation: 749
If you use scss
in your project you can import css files in the styles.scss
like so:
@import ./src/styles/some.css
The imported files will be compiled together by ng build
so there is no need to provide them in the assets
folder.
Upvotes: 2