Skip to content

Commit

Permalink
Update README.md (#115)
Browse files Browse the repository at this point in the history
Add some doc about using variables and mixins from Bootstrap, as discussed [here](#113) and [here](#9 (comment)).
  • Loading branch information
Phyks authored and justin808 committed Aug 1, 2016
1 parent d8ad462 commit 3a42c07
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,49 @@ module: {
},
```

## FAQ

### Using Bootstrap mixins and variables in your own code

You should use `sass-resources-loader` in your `webpack` config.

In your `webpack.config.js`:
```javascript
module.exports = {
// stuff removed for clarity ...
module: {
loaders: [
// stuff removed for clarity ...
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract(
'style',
'css?modules&importLoaders=2&localIdentName=[name]__[local]__[hash:base64:5]' +
'!sass' +
'!sass-resources'
),
},
// stuff removed for clarity ...
],
},
// stuff removed for clarity ...
sassResources: './config/sass-resources.scss',
}
```

And in your `./config/sass-resources.scss`:
```
// Make variables and mixins available when using CSS modules.
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_variables";
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_mixins";
```

You can then use mixins and variables from Bootstrap in your own code.

## Contributing
See [Contributing](CONTRIBUTING.md) to get started.

Expand Down

0 comments on commit 3a42c07

Please sign in to comment.