Skip to content

Commit cfdc0b9

Browse files
author
Amadou Sall
committed
docs: update stories featuring bootstrap
1 parent a0f5d81 commit cfdc0b9

File tree

2 files changed

+7
-30
lines changed

2 files changed

+7
-30
lines changed

docs/documentation/stories/global-lib.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ Some javascript libraries need to be added to the global scope, and loaded as if
44
they were in a script tag. We can do this using the `apps[0].scripts` and
55
`apps[0].styles` properties of `.angular-cli.json`.
66

7-
As an example, to use [Bootstrap 4](https://getbootstrap.com/docs/4.0/getting-started/introduction/) this is
8-
what you need to do:
7+
As an example, many [Bootstrap 4](https://getbootstrap.com/docs/4.0/getting-started/introduction/) components require [JQuery](https://jquery.com/), [Popper.js](https://popper.js.org/), and Bootstrap's JavaScript plugings to function.
8+
If we want to use those components, we will need to install JQuery and Popper.js in addition to Bootstrap:
99

10-
First install Bootstrap from `npm`:
1110

1211
```bash
1312
npm install jquery --save
1413
npm install popper.js --save
15-
npm install bootstrap@next --save
14+
npm install bootstrap --save
1615
```
1716

1817
Then add the needed script files to `apps[0].scripts`:

docs/documentation/stories/include-bootstrap.md

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ With the new project created and ready you will next need to install bootstrap t
2222
Using the `--save` option the dependency will be saved in package.json
2323

2424
```sh
25-
# version 3.x
2625
npm install bootstrap --save
27-
28-
# version 4.x
29-
npm install bootstrap@next --save
3026
```
3127

3228
### Configuring Project
@@ -74,33 +70,19 @@ cd my-app
7470
### Installing Bootstrap
7571

7672
```sh
77-
# version 3.x
78-
npm install bootstrap-sass --save
79-
80-
# version 4.x
81-
npm install bootstrap@next --save
73+
npm install bootstrap --save
8274
```
8375

8476
### Configuring Project
8577

86-
Create an empty file `_variables.scss` in `src/`.
87-
88-
If you are using `bootstrap-sass`, add the following to `_variables.scss`:
89-
90-
```sass
91-
$icon-font-path: '../node_modules/bootstrap-sass/assets/fonts/bootstrap/';
92-
```
78+
Create an empty file `_variables.scss` in `src/`. The `_variables.scss` file allows us to customize Bootstrap by overriding Sass variables
79+
used by Boostrap. For instance, you can add `$primary: red;` to use red as primary color.
9380

9481
In `styles.scss` add the following:
9582

9683
```sass
97-
// version 3
9884
@import 'variables';
99-
@import '../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap';
100-
101-
// version 4
102-
@import 'variables';
103-
@import '../node_modules/bootstrap/scss/bootstrap';
85+
@import '~bootstrap/scss/bootstrap';
10486
```
10587

10688
### Testing Project
@@ -117,10 +99,6 @@ Verify the bootstrap styled button appears.
11799
To ensure your variables are used open `_variables.scss` and add the following:
118100

119101
```sass
120-
// version 3
121-
$brand-primary: red;
122-
123-
// version 4
124102
$primary: red;
125103
```
126104

0 commit comments

Comments
 (0)