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

Prepend docz CSS classnames to prevent conflicts #1271

Closed
auermi opened this issue Nov 20, 2019 · 3 comments
Closed

Prepend docz CSS classnames to prevent conflicts #1271

auermi opened this issue Nov 20, 2019 · 3 comments

Comments

@auermi
Copy link

auermi commented Nov 20, 2019

We have a component that uses the className tag. This is causing conflicts with elements with className of tag used in the Playground.

A potential solution would be to prepend all docz CSS classes with docz-

Example:
Screen Shot 2019-11-20 at 10 01 12 AM

@rakannimer
Copy link
Contributor

Hey @auermi

Thanks for reporting this issue.

This seems prism-react-renderer specific.

We can either open an issue there with a request to allow us to prepend some string to the class names or wrap the playground editor in an iframe.

@rakannimer
Copy link
Contributor

Hey @auermi

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 it, please re-open or comment if for some reason something doesn't work for you !

If you're interested in implementation details check #1305

@auermi
Copy link
Author

auermi commented Dec 18, 2019

@rakannimer Thanks!

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

2 participants