Skip to content

Commit 4df4653

Browse files
committed
feat(studio): menus and popovers paint instantly
Menus and popovers open and close with no fade. Hover colour is unchanged.
1 parent d5e00c0 commit 4df4653

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎packages/studio/src/styles/theme.css‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@
208208
--duration-press: 120ms;
209209
--duration-hover: 150ms;
210210
--duration-expand: 160ms;
211-
--duration-open: 180ms;
211+
/* Menus and popovers share this for open and close. Zero so they paint. */
212+
--duration-open: 0ms;
212213

213214
/* ------------------------------------------------------------------ icon */
214215

‎packages/studio/src/styles/theme.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ describe("studio theme", () => {
109109
expect(vars.get("--text-lg")).toBe("1.125rem");
110110
});
111111

112+
it("reads a zero open duration so menus and popovers paint immediately", () => {
113+
expect(declaredValue("--duration-open")).toBe("0ms");
114+
});
115+
112116
it("compiles a motion-duration utility with a reduced-motion variant", async () => {
113117
const css = await build("studio.css", ["duration-press", "duration-open"]);
114118

0 commit comments

Comments
 (0)