Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Add some doc about using variables and mixins from Bootstrap, as discussed [here](shakacode#113) and [here](shakacode#9 (comment)).
  • Loading branch information
Phyks authored Jul 31, 2016
1 parent 5c51234 commit d1ca8ba
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 @@ -367,6 +367,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
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](CODE_OF_CONDUCT.md).

Expand Down

0 comments on commit d1ca8ba

Please sign in to comment.