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

[v2] docz css pollute the <Playground> #1170

Closed
crusoexia opened this issue Oct 12, 2019 · 2 comments
Closed

[v2] docz css pollute the <Playground> #1170

crusoexia opened this issue Oct 12, 2019 · 2 comments
Labels
bug Something isn't working stale v2

Comments

@crusoexia
Copy link

Bug Report

Describe the bug

Seems like there is no css isolation between the doc style and the live playground, user's component will be polluted by docz's css.

<Playground name="Default">
  <Accordion>
    <AccordionPanel active title="Lil Mud Runner kids1">
       Some text
    </AccordionPanel>
  </Accordion>
</Playground>

Expected behavior

docz's css should not pollute the playground

Environment

  • docz version: ^2.0.0-rc.55
  • OS: MacOS 10.14.6
  • Node/npm version: 10.15.0/6.12.0

** screenshot **

polluted:

Screen Shot 2019-10-12 at 9 57 56 AM

What it should like:

Screen Shot 2019-10-12 at 9 58 09 AM

@stale
Copy link

stale bot commented Dec 15, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 15, 2019
@rakannimer
Copy link
Contributor

rakannimer commented Dec 15, 2019

@Stale Not stale.

Hey @crusoexia

This is solved in 2.2.0.

To scope your playground styles and make them independent of docz theme css you have 2 choices :

  1. add a useScoping prop to your playground
<Playground useScoping> 
{
// blablabla
}
</Playground>
  1. add useScopingInPlayground : true in doczrc.js
export default {
	useScopingInPlayground: true
}

Sorry for the delay in the reply but the fix was implemented thanks to you raising this issue ! So thanks 👍

Going to close, please re-open or comment if for some reason something doesn't work for you !

If you're interested in implementation details check #1305

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale v2
Projects
None yet
Development

No branches or pull requests

2 participants