Install webpack loaders (style-loader
, css-loader
, sass-loader
& node-sass
) to support importing SCSS files:
npm install --save-dev style-loader css-loader sass-loader node-sass
Update webpack.config.js to use these loaders for *.scss
files:
{
module: {
loaders: [
{
test: /\.js?$/,
loaders: ['react-hot', 'babel'],
include: path.join(__dirname, 'src')
},
{
test: /\.scss$/,
loaders: ['style', 'css', 'sass'],
include: path.join(__dirname, 'src')
}
]
}
}
Install classnames
for handling dynamic class name strings:
npm install --save classnames
- Add styling to each component by importing a companion
.*.scss
for each component and addingclassNames
to appropriate elements within it
Go to Step 12 - Email Form Modal.