You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-9Lines changed: 15 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Get started in Storybook 7 faster with popular styling tools.
12
12
- 🧩 Configuration templates for popular tools
13
13
- ⚡️ Options for CSS modules, PostCSS, Sass, Less, and Vanilla-extract
14
14
15
-
## 🏁 Getting
15
+
## 🏁 Getting Started
16
16
17
17
### 🤖 Automatic configuration
18
18
@@ -78,9 +78,11 @@ It can also take Webpack plugins to add to the Storybook config.
78
78
```
79
79
80
80
### 🧩 Popular Configurations
81
+
81
82
Below are a few popular configurations for common styling tools to get you started. More complex configurations are possible by combining the different rules below.
82
83
83
84
#### PostCSS
85
+
84
86
```js
85
87
// Often used for tailwind
86
88
{
@@ -99,7 +101,7 @@ Below are a few popular configurations for common styling tools to get you start
99
101
{
100
102
// Gets options from `postcss.config.js` in your project root
@@ -111,6 +113,7 @@ Below are a few popular configurations for common styling tools to get you start
111
113
You can also take a look at this [example project](https://stackblitz.com/edit/github-5njuww?file=.storybook%2Fmain.ts) that uses PostCSS for **Tailwind** with Storybook:
112
114
113
115
#### CSS Modules
116
+
114
117
```js
115
118
{
116
119
name:'@storybook/addon-styling-webpack',
@@ -138,6 +141,7 @@ You can also take a look at this [example project](https://stackblitz.com/edit/g
138
141
```
139
142
140
143
#### Sass
144
+
141
145
```js
142
146
{
143
147
name:'@storybook/addon-styling-webpack',
@@ -151,7 +155,7 @@ You can also take a look at this [example project](https://stackblitz.com/edit/g
@@ -184,6 +189,7 @@ You can also take a look at this [example project](https://stackblitz.com/edit/g
184
189
```
185
190
186
191
#### Vanilla-extract
192
+
187
193
```js
188
194
{
189
195
name:'@storybook/addon-styling-webpack',
@@ -197,9 +203,9 @@ You can also take a look at this [example project](https://stackblitz.com/edit/g
197
203
test:/\.css$/,
198
204
sideEffects:true,
199
205
use: [
200
-
require.resolve("style-loader"),
206
+
import.meta.resolve("style-loader"),
201
207
{
202
-
loader:require.resolve("css-loader"),
208
+
loader:import.meta.resolve("css-loader"),
203
209
options: {},
204
210
},
205
211
],
@@ -212,7 +218,7 @@ You can also take a look at this [example project](https://stackblitz.com/edit/g
212
218
use: [
213
219
MiniCssExtractPlugin.loader,
214
220
{
215
-
loader:require.resolve('css-loader'),
221
+
loader:import.meta.resolve('css-loader'),
216
222
options: {
217
223
// Required as image imports should be handled via JS/TS import statements
218
224
url:false,
@@ -232,8 +238,8 @@ You can also take a look at this [example project](https://stackblitz.com/edit/g
232
238
This isn't working in my monorepo.
233
239
</summary>
234
240
235
-
Monorepos are a more advanced setup that may require a bit more configuration. To find out more. Refer to the Storybook FAQs on [monorepos](https://storybook.js.org/docs/faq#how-do-i-fix-module-resolution-in-special-environments).
236
-
241
+
Monorepos are a more advanced setup that may require a bit more configuration. To find out more. Refer to the Storybook FAQs on [monorepos](https://storybook.js.org/docs/faq#how-do-i-fix-module-resolution-in-special-environments).
0 commit comments