Skip to content

Commit ec5efce

Browse files
committed
fix(storybook): grow story root to fit reserved overlay space
1 parent 9289218 commit ec5efce

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

.storybook/global.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ html body {
2626
width: 300px;
2727
}
2828

29+
/* Grow the root to fit overlaySpace reservations so Pixel's autofit
30+
crop keeps portalled overlays in frame. */
31+
#root:has([data-overlay-space]) {
32+
width: max-content;
33+
}
34+
2935
/* Story stand-in: a VS Code secondary button like consuming webviews render. */
3036
.story-trigger {
3137
padding: 0.4em 1em;

packages/ui/src/storybook.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function overlaySpace(
3333
: { width, height };
3434
return function OverlaySpace(Story) {
3535
return (
36-
<div style={style}>
36+
<div data-overlay-space style={style}>
3737
<Story />
3838
</div>
3939
);

0 commit comments

Comments
 (0)