Skip to content

Commit

Permalink
[design-studio] Add JSON preview styling
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard authored and rexxars committed Oct 6, 2020
1 parent 9155e22 commit 41e65dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions packages/design-studio/documentViews/jsonPreview.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import 'part:@sanity/base/theme/variables-style';

.root {
font-family: var(--font-family-monospace);
background: var(--code-bg);
color: var(--code-color);
padding: var(--medium-padding);
margin: 0;
}
4 changes: 3 additions & 1 deletion packages/design-studio/documentViews/jsonPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react'

import styles from './jsonPreview.css'

export function JSONPreviewDocumentView(props: any) {
return <pre>{JSON.stringify(props.document, null, 2)}</pre>
return <pre className={styles.root}>{JSON.stringify(props.document.displayed, null, 2)}</pre>
}

0 comments on commit 41e65dc

Please sign in to comment.