Skip to content

Commit b1d0615

Browse files
eye0frahansl
authored andcommitted
docs: add font-awesome SASS integration
add SASS integration for font-awesome Close #5456
1 parent ee05334 commit b1d0615

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/documentation/stories/include-font-awesome.md

+19
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Include [Font Awesome](http://fontawesome.io/)
44

55
[Font Awesome](http://fontawesome.io/) gives you scalable vector icons that can instantly be customized — size, color, drop shadow, and anything that can be done with the power of CSS.
6+
67
Create a new project and navigate into the project...
78
```
89
ng new my-app
@@ -14,6 +15,8 @@ Install the `font-awesome` library and add the dependency to package.json...
1415
npm install --save font-awesome
1516
```
1617

18+
### Using CSS
19+
1720
To add Font Awesome CSS icons to your app...
1821
```json
1922
// in .angular-cli.json
@@ -23,6 +26,22 @@ To add Font Awesome CSS icons to your app...
2326
"../node_modules/font-awesome/css/font-awesome.css"
2427
]
2528
```
29+
### Using SASS
30+
31+
Create an empty file _variables.scss in src/.
32+
33+
Add the following to _variables.scss:
34+
35+
```
36+
$fa-font-path : '../node_modules/font-awesome/fonts';
37+
```
38+
In styles.scss add the following:
39+
40+
```
41+
@import 'variables';
42+
@import '../node_modules/font-awesome/scss/font-awesome';
43+
```
44+
### Test
2645

2746
Run `ng serve` to run your application in develop mode, and navigate to `http://localhost:4200`.
2847

0 commit comments

Comments
 (0)