Skip to content

Commit 172eb96

Browse files
authored
Merge pull request #2 from Stackup-Rwanda/ch-setup-sass-processing-171380687
#171380687 Setup sass processing
2 parents df48ae3 + f8b1347 commit 172eb96

File tree

6 files changed

+26
-3
lines changed

6 files changed

+26
-3
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@
2323
4. [TravisCI](https://travis-ci.org/) for continuous integration
2424
5. [JestJS](https://jestjs.io/docs/en/webpack) for testing
2525
6. [Enzyme](https://enzymejs.github.io/enzyme/docs/installation/) for DOM testing
26+
27+
### D. Dependencies
28+
1. [node-sass](https://www.npmjs.com/package/node-sass)
29+
2. [sass](https://www.npmjs.com/package/sass)
30+
3. [sass-loader](https://www.npmjs.com/package/sass-loader)

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
"eslint-plugin-import": "^2.20.2",
6161
"eslint-plugin-jsx-a11y": "^6.2.3",
6262
"eslint-plugin-react": "^7.19.0",
63-
"eslint-plugin-react-hooks": "^2.5.1"
63+
"eslint-plugin-react-hooks": "^2.5.1",
64+
"node-sass": "^4.14.1",
65+
"sass": "^1.26.5",
66+
"sass-loader": "^8.0.2"
6467
}
6568
}

src/entry/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
33
import App from './App';
4+
import '../styles/sass/index.scss';
5+
import '../styles/css/index.css';
46

57
ReactDOM.render(<App />, document.getElementById('root'));

src/styles/css/index.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
h1 {
2+
font-family: Arial, Helvetica, sans-serif;
3+
text-align: center;
4+
padding: 20px;
5+
}

src/styles/sass/index.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
$color: #00A799;
2+
$text: #FFFFFF;
3+
4+
body {
5+
background-color: $color;
6+
color: $text;
7+
}

webpack.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ module.exports = (env) => ({
2626
use: ['babel-loader'],
2727
},
2828
{
29-
test: /\.css$/,
30-
loader: ['style-loader', 'css-loader'],
29+
test: /\.(scss|css)$/,
30+
exclude: /node_modules/,
31+
loader: ['style-loader', 'css-loader', 'sass-loader'],
3132
},
3233
{
3334
test: /\.(png|jpg|svg|gif|jpeg)?$/,

0 commit comments

Comments
 (0)