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
:
- Adding the CSS file dist path as
@import
to the styles.css. - 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?