Skip to content

Commit 1c3469f

Browse files
Phyksjustin808
authored andcommitted
Update README.md (#115)
Add some doc about using variables and mixins from Bootstrap, as discussed [here](#113) and [here](#9 (comment)).
1 parent 2af015f commit 1c3469f

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,49 @@ module: {
374374
},
375375
```
376376

377+
## FAQ
378+
379+
### Using Bootstrap mixins and variables in your own code
380+
381+
You should use `sass-resources-loader` in your `webpack` config.
382+
383+
In your `webpack.config.js`:
384+
```javascript
385+
module.exports = {
386+
387+
// stuff removed for clarity ...
388+
389+
module: {
390+
loaders: [
391+
// stuff removed for clarity ...
392+
{
393+
test: /\.scss$/,
394+
loader: ExtractTextPlugin.extract(
395+
'style',
396+
'css?modules&importLoaders=2&localIdentName=[name]__[local]__[hash:base64:5]' +
397+
'!sass' +
398+
'!sass-resources'
399+
),
400+
},
401+
// stuff removed for clarity ...
402+
],
403+
},
404+
405+
// stuff removed for clarity ...
406+
407+
sassResources: './config/sass-resources.scss',
408+
}
409+
```
410+
411+
And in your `./config/sass-resources.scss`:
412+
```
413+
// Make variables and mixins available when using CSS modules.
414+
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_variables";
415+
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_mixins";
416+
```
417+
418+
You can then use mixins and variables from Bootstrap in your own code.
419+
377420
## Contributing
378421
See [Contributing](CONTRIBUTING.md) to get started.
379422

0 commit comments

Comments
 (0)