Browse Source

Small fixes

main
Dan Abramov 2 years ago
parent
commit
78e9fb8e8f
  1. 6
      beta/src/components/MDX/Sandpack/Preview.tsx
  2. 2
      beta/src/styles/sandpack.css

6
beta/src/components/MDX/Sandpack/Preview.tsx

@ -88,6 +88,10 @@ export function Preview({
} }
} }
if (rawError != null && rawError.title === 'Runtime Exception') {
rawError.title = 'Runtime Error';
}
// It changes too fast, causing flicker. // It changes too fast, causing flicker.
const error = useDebounced(rawError); const error = useDebounced(rawError);
@ -179,7 +183,7 @@ export function Preview({
: isExpanded : isExpanded
? 'sticky' ? 'sticky'
: undefined, : undefined,
top: isExpanded ? '4rem' : undefined, top: isExpanded ? '2rem' : undefined,
}}> }}>
<iframe <iframe
ref={iframeRef} ref={iframeRef}

2
beta/src/styles/sandpack.css

@ -79,6 +79,7 @@ html.dark .sp-wrapper {
border-bottom-left-radius: 0.5rem; border-bottom-left-radius: 0.5rem;
border-bottom-right-radius: 0.5rem; border-bottom-right-radius: 0.5rem;
overflow: initial;
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.sp-layout > .sp-stack { .sp-layout > .sp-stack {
@ -259,7 +260,6 @@ html.dark .sandpack--playground .sp-overlay {
.sp-layout { .sp-layout {
min-height: 216px; min-height: 216px;
overflow: initial !important;
} }
.sp-layout > .sp-stack:nth-child(1) { .sp-layout > .sp-stack:nth-child(1) {

Loading…
Cancel
Save