Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global section styles cascade on components in stories #16929

Closed
AkimaLunar opened this issue Dec 6, 2021 · 1 comment
Closed

Global section styles cascade on components in stories #16929

AkimaLunar opened this issue Dec 6, 2021 · 1 comment

Comments

@AkimaLunar
Copy link

Describe the bug
There are global tag styles inside stories’ iframes that cascade on the previewed components. I am guessing the styles potentially are coming from this file.

image

To Reproduce
I have a component that uses <section> tag: repro repo. It doesn’t render correctly because the Storybook’s global <section> styles are cascading on the component styles.

System

Environment Info:

  System:
    OS: Linux 5.10 Ubuntu 20.04 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
  Binaries:
    Node: 16.7.0 - ~/.nvm/versions/node/v16.7.0/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v16.7.0/bin/yarn
    npm: 8.1.4 - ~/.nvm/versions/node/v16.7.0/bin/npm
  npmPackages:
    @storybook/addon-actions: ^6.4.8 => 6.4.8 
    @storybook/addon-essentials: ^6.4.8 => 6.4.8 
    @storybook/addon-links: ^6.4.8 => 6.4.8 
    @storybook/react: ^6.4.8 => 6.4.8 

Is it possible to encapsulate styling by replacing tag styling with class styling (eg section could be .sb-doc-section) or hashing?

@AkimaLunar
Copy link
Author

I realized this was part of the boilerplate code 👍 Maybe still worth encapsulating those styles even though it is part of a demo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant