Skip to content

Commit

Permalink
resolve scss import issue.
Browse files Browse the repository at this point in the history
Please refer to:
storybookjs/presets#195
  • Loading branch information
solring committed Aug 5, 2021
1 parent 3d50193 commit e2c6561
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
1 change: 0 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module.exports = {
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/preset-create-react-app",
'@storybook/preset-scss',
'@storybook/addon-backgrounds'
]
Expand Down
7 changes: 2 additions & 5 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// old way to import scss file
import '!style-loader!css-loader!sass-loader!../src/index.scss';
// WORKAROUND: use normal import when running test
//import '../src/index.scss';
import '../src/index.scss';

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
Expand Down Expand Up @@ -32,4 +29,4 @@ export const parameters = {
},
],
},
}
}
2 changes: 1 addition & 1 deletion src/assets/style/_images.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
height: 40px;
background: center / cover no-repeat url(../images/logo-ANSWER.svg);
// For storybook ↓
//background: center / cover no-repeat url(./assets/images/logo-ANSWER.svg);
//background: center / cover no-repeat url(/src/assets/images/logo-ANSWER.svg);

&.logo--sm {
width: 40px;
Expand Down
7 changes: 0 additions & 7 deletions src/components/HomeScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ export default function HomeScreen() {

<ul className="ms-3">
<li key={1} style={{"list-style": 'disc'}}>
<p>
Current official SCSS support of Storybook is not working.
Workaround is required.
Please refer to <a href="https://github.com/solring/react-scss-template">here.</a>
</p>
</li>
<li key={2} style={{"list-style": 'disc'}}>
<p>
Path resolving mechanism is different between node-scss and webpack style loaders.
Please refer to <a href="https://github.com/solring/react-scss-template/issues/1">This issue.</a>
Expand Down

0 comments on commit e2c6561

Please sign in to comment.