Skip to content

Commit 2ee9034

Browse files
Sass-loader Integration
1 parent a981261 commit 2ee9034

5 files changed

Lines changed: 43 additions & 2 deletions

File tree

.storybook/main.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const path = require('path');
12
module.exports = {
23
"stories": [
34
"../src/**/*.stories.mdx",
@@ -11,5 +12,15 @@ module.exports = {
1112
"framework": "@storybook/react",
1213
"core": {
1314
"builder": "@storybook/builder-webpack5"
15+
},
16+
"webpackFinal": async (config) => {
17+
config.module.rules.push({
18+
rules: [{
19+
test: /\.scss$/,
20+
use: ['style-loader', 'css-loader', 'sass-loader'],
21+
include: path.resolve(__dirname, '../')
22+
}]
23+
});
24+
return config;
1425
}
1526
}

.storybook/preview.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// import './main.css';
12
export const parameters = {
23
actions: { argTypesRegex: "^on[A-Z].*" },
34
controls: {

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
"react": "^18.2.0",
6767
"react-dom": "^18.2.0",
6868
"react-scripts": "5.0.1",
69+
"sass": "^1.58.3",
70+
"sass-loader": "^13.2.0",
6971
"style-loader": "^3.3.1",
7072
"terser-webpack-plugin": "^5.3.5",
7173
"ts-loader": "^9.4.2",
@@ -101,6 +103,5 @@
101103
"jsx",
102104
"node"
103105
]
104-
},
105-
"dependencies": {}
106+
}
106107
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.stepperContainer {
2+
display: flex;
3+
width: 100%;
4+
height: 100%;
5+
flex-direction: column;
6+
margin-left: 10px;
7+
}
8+
9+
.eachBubble {
10+
border-radius: 50%;
11+
height: 24px;
12+
width: 24px;
13+
background-color: blue;
14+
color: white;
15+
display: flex;
16+
align-items: center;
17+
justify-content: center;
18+
}
19+
20+
.eachStep {
21+
display: flex;
22+
flex-direction: column;
23+
align-items: 'center'
24+
}

webpack.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ module.exports = {
5757
{
5858
test: /\.css$/,
5959
use: ['style-loader', 'css-loader']
60+
},
61+
{
62+
test: /\.scss$/,
63+
use: ['sass-loader']
6064
}
6165
]
6266
},

0 commit comments

Comments
 (0)