Storybook: [Need help]How to set reset.css for all the component stories in the iframe?

Created on 20 Sep 2019  路  4Comments  路  Source: storybookjs/storybook

The component will be rendered in the iframe. But I want to set the reset.css to clean the browser default style of the iframe. The reset.css is not included in the component code. I wonder how to solve this problem?

core question / support

Most helpful comment

or you can use a custom head tag <link rel="stylesheet" type="text/css" href="pathto/reset.css">
https://storybook.js.org/docs/configurations/add-custom-head-tags/

All 4 comments

Hi you could import your reset css in .storybook/config.js

import '!style-loader!css-loader!sass-loader!../src/styles/reset.css';

or you can use a custom head tag <link rel="stylesheet" type="text/css" href="pathto/reset.css">
https://storybook.js.org/docs/configurations/add-custom-head-tags/

Hi you could import your reset css in .storybook/config.js

import '!style-loader!css-loader!sass-loader!../src/styles/reset.css';

It works! Thanks a lot~

or you can use a custom head tag <link rel="stylesheet" type="text/css" href="pathto/reset.css">
https://storybook.js.org/docs/configurations/add-custom-head-tags/

It also works! Thanks very much~

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ZigGreen picture ZigGreen  路  3Comments

rpersaud picture rpersaud  路  3Comments

sakulstra picture sakulstra  路  3Comments

arunoda picture arunoda  路  3Comments

alexanbj picture alexanbj  路  3Comments