Docz: No padding around LivePreview

Created on 16 Dec 2019  ·  13Comments  ·  Source: doczjs/docz

Bug Report

Describe the bug

There's no padding around LivePreview. Have a look at the screenshot attached below.

I found out that style object that are being passed to the LivePreview are having wrong properties. I made a screenshot for this too.

Environment

  • docz version: [2.2.0]
  • OS: [Windows 10]

Additional context/Screenshots
Untitled
Untitled2

bug fixed pending-release stale

Most helpful comment

Temporory workaround

Add following CSS in your styles somwhere

div[data-testid="live-preview"] {
  padding: 15px;
}

All 13 comments

Thanks @baldarian for catching and reporting this !

It will be fixed in the next official release, meanwhile you can try it (2.3.0-alpha.3) with yarn add docz@next

@rakannimer Good to hear. Thanks.

Thanks @baldarian for catching and reporting this !

It will be fixed in the next official release, meanwhile you can try it (2.3.0-alpha.3) with yarn add docz@next

still dont't work

Confirmed that ^2.3.0-alpha.3 fixed it for me.

UPDATE: @rakannimer While that issue is fixed, it seems that Headings now bump right up next to the Playgrounds?

Temporory workaround

Add following CSS in your styles somwhere

div[data-testid="live-preview"] {
  padding: 15px;
}

I think the most consistent option would be to replace style={styles.preview} in Playground with sx={styles.preview} so that the styles of this element will be handled by theme-ui as well.

- <LivePreview style={styles.preview} data-testid="live-preview" />
+ <LivePreview sx={styles.preview} data-testid="live-preview" />

This solved the rendering issues in my case.

UPDATE: @rakannimer While that issue is fixed, it seems that Headings now bump right up next to the Playgrounds?

Yeah, looks like gatsby-theme-docz@next headers have either an erroneous margin: 0 or the Playground wrapper should have some bottom margin.

I think some bottom margin on Playground is the superior style.

(just noticed #1396 – lol)

I think the most consistent option would be to replace style={styles.preview} in Playground with sx={styles.preview} so that the styles of this element will be handled by theme-ui as well.

This is a temporary patch

// src/gatsby-theme-docz/src/components/Playground/styles.js

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

export const preview = {
  margin: 0,
  padding: '20px'
}

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.

Not stale

On Sun, May 24, 2020 at 6:56 PM stale[bot] notifications@github.com wrote:

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.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/doczjs/docz/issues/1325#issuecomment-633339693, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AABPSRPTSQGWXBOOJRY7SFLRTHF6TANCNFSM4J3FDA3Q
.

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.

not stale

On Fri, Jul 24, 2020 at 12:04 AM stale[bot] notifications@github.com
wrote:

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.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/doczjs/docz/issues/1325#issuecomment-663377710, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AABPSROPP7HA4AKB4YVOBCDR5EW7BANCNFSM4J3FDA3Q
.

🤦‍♀️

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ivan-dalmet picture ivan-dalmet  ·  83Comments

maxguzenski picture maxguzenski  ·  24Comments

robjac picture robjac  ·  41Comments

tadeuszwojcik picture tadeuszwojcik  ·  30Comments

lorenzorapetti picture lorenzorapetti  ·  31Comments