Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/demo/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ a {
}
.studio-sidebar {
min-width: 0;
max-height: 920px;
overflow-y: auto;
overscroll-behavior: contain;
display: grid;
grid-template-rows: auto 1fr;
background: #fff;
Expand Down Expand Up @@ -815,6 +818,9 @@ a {
border-right: 0;
}
.studio-sidebar {
max-height: none;
overflow-y: visible;
overscroll-behavior: auto;
border-top: 1px solid var(--border);
}
.face-stage {
Expand Down
23 changes: 23 additions & 0 deletions apps/demo/src/lib/layout.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { readFileSync } from "node:fs";
import { resolve } from "node:path";

import { describe, expect, it } from "vitest";

const stylesheet = readFileSync(
resolve(process.cwd(), "apps/demo/src/index.css"),
"utf8",
);

describe("playground sidebar layout", () => {
it("makes the desktop Configure and Code column independently scrollable", () => {
expect(stylesheet).toMatch(
/\.studio-sidebar\s*\{[^}]*max-height:\s*920px;[^}]*overflow-y:\s*auto;[^}]*overscroll-behavior:\s*contain;/s,
);
});

it("returns the sidebar to normal page flow in the stacked mobile layout", () => {
expect(stylesheet).toMatch(
/@media \(max-width:\s*820px\)[\s\S]*?\.studio-sidebar\s*\{[^}]*max-height:\s*none;[^}]*overflow-y:\s*visible;[^}]*overscroll-behavior:\s*auto;/s,
);
});
});