-3

Like styles.css, I want to add my own CSS (like my_custom.css, not Bootstrap) globally in my Angular project.

What's the correct way to do this?

Roland Rácz
  • 2,879
  • 3
  • 18
  • 44
  • 3
    What have you tried to achieve your wanted results? What has your research concerning your problem shown? Can you provide code of your tries? [How do I ask a good question](https://stackoverflow.com/help/how-to-ask), [How much research effort is expected](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users) and [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) might be helpful to improve your question. – Geshode Jan 18 '18 at 14:52
  • 3
    Possible duplicate of [Angular 2 - Global CSS file](https://stackoverflow.com/questions/40273463/angular-2-global-css-file) – mxr7350 Jan 18 '18 at 14:52
  • why not just put your styles in that file? why cant you do that? – mast3rd3mon Jan 18 '18 at 14:55

2 Answers2

1

You can add you style file(i.e custom.css) at project root level(same level as styles.css) and then you can register it in angular-cli.json i.e

"apps":[
  {
    "styles":["style.css","custom.css"]
  }
]
Borad Akash
  • 754
  • 1
  • 8
  • 21
1

you can import CSS files in your global style style.css file.

@import 'custom.css';
Ringo
  • 601
  • 5
  • 14