Angular Material and Bootstrap 4
For a rather large Angular project (7.2.10), I use the Angular Material components as well. As you may probably know this library does not provide out of the box a good layout system, CSS reset and utilities...
So why not include these elements from the Bootstrap 4 framework ?
I'll show you how you can add parts of the Bootstrap to your Angular project.
Thanks...
So why not include these elements from the Bootstrap 4 framework ?
I'll show you how you can add parts of the Bootstrap to your Angular project.
Add Bootstrap to package.json
You first need to include the Bootstrap to your dependencies :
Add Bootstrap parts to the global stylesheet (
When adding the Reboot, we have to fix some issues by including :
npm install bootstrap --save
Add Bootstrap parts to the global stylesheet (src/style.scss
)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "variables"; | |
@import "~bootstrap/scss/functions"; | |
@import "~bootstrap/scss/variables"; | |
@import "~bootstrap/scss/mixins"; | |
@import "~bootstrap/scss/reboot"; | |
@import "~bootstrap/scss/grid"; | |
@import "~bootstrap/scss/utilities"; | |
@import "reset"; |
When adding the Reboot, we have to fix some issues by including :
src/_variables.scss
src/_reset.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$link-color: #3f51b5; | |
$link-hover-color: currentColor; | |
$link-hover-decoration: none; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
&:active, | |
:focus { | |
outline: none !important; // 1 | |
} | |
} | |
label { | |
margin-bottom: 0; // 2 | |
} | |
a:not(.mat-button):not(.mat-raised-button):not(.mat-fab):not(.mat-mini-fab):not([mat-list-item]) { | |
color: #3f51b5; // 3 | |
} |
Comments
Post a Comment