Closed spider9375 closed 1 year ago
{
name: '@storybook/addon-styling-webpack',
options: {
rules: [
{
test: /\.scss$/,
use: [
'style-loader',
'css-loader',
{
loader: 'sass-loader',
options: {
implementation: require.resolve('sass'),
sassOptions: {
includePaths: ['node_modules'],
additionalData: `@import "src/lib/styles/sass/theme.scss";`
},
},
},
],
},
],
},
},
Hi @spider9375 👋
I don't have a lot of context on this :export { ... }
syntax but it looks like an old form of css modules called icss
which could be configured through the css-loader like so:
{
loader: 'css-loader',
options: {
modules: {
mode: 'icss',
},
},
},
You can read more about it in the css-loader documentation.
However, if you're up for a change, I'd recommend looking into style-dictionary
.
It lets you define you design tokens in plain json files and then generates consumable files for scss and JS/TS to import and use.
in my theme provider i have an import
import breakpoints from "../../sass/variables/_breakpoints.scss";
which has
when i start storybook i get "Cannot read properties of undefined (reading 'XS')"
Is this addon supposed to fix this or where should i go?