0

There are two ways of adding a Bootstrap CSS file to an Angular project after having it added to the project using yarn add bootstrap@4.1.1:

  1. Adding the CSS file dist path as @import to the styles.css.
  2. Adding the CSS file path to the styles section within angular.json`.

1st option:

@import "~bootstrap/dist/css/bootstrap.css";

2nd option:

"styles": [
  "src/styles.css",
  "./node_modules/bootstrap/dist/css/bootstrap.min.css"
],

So, both work, but which one is the better one? Is there a better one? Or is it just a matter of personal preference?

Socrates
  • 8,724
  • 25
  • 66
  • 113
  • 1
    Use SASS in your Angular project, and import the SASS source files from Bootstrap. You can then define your own customization of the parameter to define the style of Bootstrap you want. – Reactgular May 28 '18 at 21:15

1 Answers1

0

There is a bootstrap powered by angular:

https://ng-bootstrap.github.io/#/home

check https://ng-bootstrap.github.io/#/getting-started to see their method.

JosephWorks
  • 682
  • 4
  • 21