React-styleguidist: Custom CSS can break Styleguidist's styles

Created on 7 May 2019  路  2Comments  路  Source: styleguidist/react-styleguidist

Current behavior

requiring a custom CSS in the config can break Styleguidist's styles. In my case the CSS is semantic-ui and the Styleguidist styles are section headers and bodies. Would there be a way to fix this? I imagine quite some scenarios require using a custom CSS.

This is getting into feature request territory and I'm really just guessing about stuff I know very little about, but since Styleguidist is already using JSS, maybe applying a CSS reset specifically to Styleguidist components would work? Or putting examples in iframes?

To reproduce

https://github.com/andrewpeterprifer/example

Expected behavior

Styleguidist styles should be preserved.

help wanted

Most helpful comment

@sapegin no promises yet but I will look into the iframe solution when I have some time. I wouldn't worry about performance, it seems to work well in other similar projects and otherwise people can always split their style guides into multiple pages (I guess you'd need quite a collection for this to become a problem).

All 2 comments

since Styleguidist is already using JSS, maybe applying a CSS reset to Styleguidist components would work?

That's what we're trying to do but it's not that easy ;-/

https://react-styleguidist.js.org/docs/development.html#styles-1

Or putting examples in iframes?

This can help with some other things too, like responsive testing. I'm not sure about performance, but worth trying, if you have some time and want to contribute ;-)

@sapegin no promises yet but I will look into the iframe solution when I have some time. I wouldn't worry about performance, it seems to work well in other similar projects and otherwise people can always split their style guides into multiple pages (I guess you'd need quite a collection for this to become a problem).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lyz810 picture lyz810  路  3Comments

mheathcote1977 picture mheathcote1977  路  3Comments

mealeyst picture mealeyst  路  3Comments

davidjb picture davidjb  路  3Comments

magicmark picture magicmark  路  3Comments