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

namespace prism css to avoid collisions with component css #1032

Closed
dusty opened this issue Aug 28, 2019 · 3 comments
Closed

namespace prism css to avoid collisions with component css #1032

dusty opened this issue Aug 28, 2019 · 3 comments
Labels
bug Something isn't working v2

Comments

@dusty
Copy link

dusty commented Aug 28, 2019

I have a component that is using the bulma css framework. In docz 2.0.0-rc.5 when I view the source of the component, the styles are overridden by bulma which also targets a .tag class name.

Example:
Screen Shot 2019-08-28 at 12 28 57 PM

If I remove the CSS import, the view source looks great, but of course my component doesn't anymore.

Screen Shot 2019-08-28 at 12 43 09 PM

It would be nice if prism highlighter could be prefixed so its css styling could work independently of whatever CSS the components docz is showing uses.

@stale
Copy link

stale bot commented Oct 28, 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 Oct 28, 2019
@rakannimer rakannimer added bug Something isn't working and removed enhancement stale labels Oct 29, 2019
@rakannimer
Copy link
Contributor

rakannimer commented Oct 29, 2019

I think this more of an issue than an enhancement. Happy to help anyone who would like to take this on !

@rakannimer
Copy link
Contributor

Hey @dusty

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

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

No branches or pull requests

2 participants