From the course: Learning the Angular CLI

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Adding a CSS framework

Adding a CSS framework - Angular Tutorial

From the course: Learning the Angular CLI

Adding a CSS framework

- [Instructor] A common need often involves the usage of a CSS framework like Bootstrap. Using the CLI to add a CSS framework as a global style is actually quite simple. Let's first install Bootstrap. npm install boostrap and we'll be using version 4.5.2. Once that is installed, head over to angular.json and add in the path for the bootstrap CSS file in the styles array. This will be a node.modules/bootstrap/dist/css and the file will be bootstrap.min.css. Now, when you run a build of your application the bootstrap CSS file will be added as a global style sheet to your application. You won't see this injected as a link tag in the index.html file, but they will indeed be added to your application. These styles will be loaded when the Angular app first loads. Let's run a build to make sure everything builds correctly, ng build dash dash configuration equals production.

Contents