Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include custom styles with Angular CLI

I would like to add my own custom CSS to my new Angular CLI app...

However I am struggling to get this to work and there is not much documentation on how this works which makes it a bit of guess work!

In the image below I have added my custom style sheet in the .angular-cli.json file as so:

  "styles": [
    "styles.css",
    "app/assets/css/styles.css"
  ],

This however does not work...

Kindly advise!

enter image description here

like image 359
HappyCoder Avatar asked Mar 01 '17 09:03

HappyCoder


1 Answers

As per your folder structure, correct path is assets/css/styles.css so change it in your angular-cli.json file as below and check it.

"styles": [
  "styles.css",
  "assets/css/styles.css"
],
like image 65
ranakrunal9 Avatar answered Sep 28 '22 08:09

ranakrunal9