Docz: How to update styles of playground preview without overriding Playground component

Created on 14 Jan 2020  路  6Comments  路  Source: doczjs/docz

Question

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

Description
I want to customize playground styles, (this line in particular https://github.com/doczjs/docz/blob/95b0d7f9b304d3f5abbb4232018cad69f6fdfaa6/core/gatsby-theme-docz/src/components/Playground/styles.js#L41)

Most helpful comment

lol... that's my comment 馃槉 glad it worked

All 6 comments

lol... that's my comment 馃槉 glad it worked

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',
}

+1 to use Theme UI for the Playground component

@abdullahtariq1171 Has your question been answered?

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

Solution: https://github.com/doczjs/docz/issues/1360#issuecomment-580715780

Closing the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pedronauck picture pedronauck  路  68Comments

Viktor19931 picture Viktor19931  路  22Comments

maxguzenski picture maxguzenski  路  24Comments

ivan-dalmet picture ivan-dalmet  路  83Comments

xingBri picture xingBri  路  29Comments