-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suggest sass instead of node-sass package (#10779)
- Loading branch information
1 parent
007a028
commit 71cbe59
Showing
4 changed files
with
33 additions
and
28 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ While you don’t have to use any specific library to integrate Bootstrap with R | |
Each project's respective documentation site has detailed instructions for installing and using them. Both depend on the Bootstrap css file so install that as well: | ||
|
||
```sh | ||
npm install --save bootstrap | ||
npm install bootstrap | ||
``` | ||
|
||
Alternatively you may use `yarn`: | ||
|
@@ -33,19 +33,19 @@ Sometimes you might need to tweak the visual styles of Bootstrap (or equivalent | |
|
||
As of `[email protected]` you can import `.scss` files. This makes it possible to use a package's built-in Sass variables for global style preferences. | ||
|
||
To enable `scss` in Create React App you will need to install `node-sass`. | ||
To enable `scss` in Create React App you will need to install `sass`. | ||
|
||
```sh | ||
npm install --save node-sass | ||
npm install sass | ||
``` | ||
|
||
Alternatively you may use `yarn`: | ||
|
||
```sh | ||
yarn add node-sass | ||
yarn add sass | ||
``` | ||
|
||
To customize Bootstrap, create a file called `src/custom.scss` (or similar) and import the Bootstrap source stylesheet. Add any overrides _before_ the imported file(s). You can reference [Bootstrap's documentation](https://getbootstrap.com/docs/4.1/getting-started/theming/#css-variables) for the names of the available variables. | ||
To customize Bootstrap, create a file called `src/custom.scss` (or similar) and import the Bootstrap source stylesheet. Add any overrides _before_ the imported file(s). You can reference [Bootstrap's documentation](https://getbootstrap.com/docs/4.6/getting-started/theming/#variable-defaults) for the names of the available variables. | ||
|
||
```scss | ||
// Override default variables before the import | ||
|
@@ -55,7 +55,7 @@ $body-bg: #000; | |
@import '~bootstrap/scss/bootstrap.scss'; | ||
``` | ||
|
||
> **Note:** You must prefix imports from `node_modules` with `~` as displayed above. | ||
> **Note:** You can prefix paths with `~`, as displayed above, to resolve modules from `node_modules`. | ||
Finally, import the newly created `.scss` file instead of the default Bootstrap `.css` in the beginning of your `src/index.js` file, for example: | ||
|
||
|
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
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