erikras / react-redux-universal-hot-example

A starter boilerplate for a universal webapp using express, react, redux, webpack, and react-transform
MIT License
11.99k stars 2.5k forks source link

Use bootstrap mixins in component styles #996

Open duminhtam opened 8 years ago

duminhtam commented 8 years ago

Hi, how can we use bootstrap mixins in component styles; folder /src/components/SurveyForm/SurveyForm.scss . It don't inherit the mixins from bootstrap. Some of these mixins are: http://www.sitepoint.com/5-useful-sass-mixins-bootstrap/

jaraquistain commented 8 years ago

I'd be curious if anyone has a good solution for this as well. To get around it I included the compass-mixins library and made sure my webpack config included node_modules for scss:

{test: /\.scss$/, loader: "style!css?importLoaders=2&sourceMap!postcss-loader?!sass?outputStyle=expanded&sourceMap&includePaths[]=node_modules"}

doing that allowed me to say @import "compass-mixins/lib/compass";, giving me access to all compass mixins in my modules.

(Really what I did was create a global _imports.scss that has everything any module might want to include, including @import "compass-mixins/lib/compass";, and @import THAT in every module.