Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

How to update styles of playground preview without overriding Playground component #1360

Closed
abdullahtariq1171 opened this issue Jan 14, 2020 · 6 comments

Comments

@abdullahtariq1171
Copy link

Question

How to update styles of playground preview without overriding Playground component.

Description
I want to customize playground styles, (this line in particular

)

@trybick
Copy link

trybick commented Jan 30, 2020

A global CSS selector worked for me
#1325 (comment)

Creating a custom component might work too
https://github.com/doczjs/docz/blob/master/examples/shadowed-playground/src/gatsby-theme-docz/components/Playground/index.js

@abdullahtariq1171
Copy link
Author

lol... that's my comment 😊 glad it worked

@mickaelzhang
Copy link
Contributor

Not sure but you probably could shadow the styles.js file I guess?

import { preview as defaultPreview } from 'gatsby-theme-docz/src/components/Playground/styles'

export * from 'gatsby-theme-docz/src/components/Playground/styles.js'

export const editor = {
	...defaultPreview,
	padding: '100px',
}

@drewlustro
Copy link

+1 to use Theme UI for the Playground component

@mickaelzhang
Copy link
Contributor

@abdullahtariq1171 Has your question been answered?

@abdullahtariq1171
Copy link
Author

hey @mickaelzhang yeah your solution looks better than using global css selector. I discovered shadowing component technique late. Thanks

Solution: #1360 (comment)

Closing the issue.

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

No branches or pull requests

4 participants