Skip to content

Commit d49babc

Browse files
authored
fix(dotcom): show open-state hint on main menu, page menu, and zoom menu triggers (tldraw#8813)
In tldraw.com the main menu, page menu, and zoom menu triggers did not display the open-state hint (the subtle gradient highlight) when their menus were open. The quick actions menu trigger does show the hint, since it sits inside the SDK's main toolbar where a container-scoped CSS rule turns it on. Two underlying causes: - The dotcom main menu trigger had a CSS rule that set the gradient background on `[data-state='open']`, but the SDK's base `.tlui-button::after` rule defaults to `opacity: 0`. Without setting `opacity: 1`, the gradient was invisible. - The SDK's hint rules for `[data-state='open']` triggers were scoped to `.tlui-menu-zone` and `.tlui-main-toolbar`. The page menu and zoom menu triggers can render outside both — for example in the dotcom layout — so no rule turned on their hint when open. Fix: add explicit hint rules on the page menu and zoom menu trigger classes themselves, and set `opacity: 1` on the existing dotcom main menu rule. The page menu uses a downward gradient (it opens down) and the zoom menu uses an upward gradient (it opens up). Closes tldraw#8812 ### Change type - [x] `bugfix` ### Test plan 1. Open tldraw.com. 2. Click the main menu trigger (top-left). The trigger should show the gradient hint while the menu is open. 3. Click the page menu trigger. The trigger should show the gradient hint while the menu is open. 4. Open the zoom menu (bottom-left). The trigger should show the gradient hint while the menu is open. 5. Confirm the quick actions menu trigger still shows its hint when open. ### Release notes - Fix missing open-state hint on the main menu, page menu, and zoom menu triggers in tldraw.com.
1 parent d1c3563 commit d49babc

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

apps/dotcom/client/src/tla/components/TlaEditor/top.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ button.topLeftInputNameWidthSetter {
202202

203203
.topLeftMainMenuTrigger[data-state='open']::after {
204204
background: linear-gradient(180deg, rgba(144, 144, 144, 0) 0%, var(--tl-color-muted-2) 100%);
205+
opacity: 1;
205206
}
206207

207208
/* ------------------- Top right ------------------ */

packages/tldraw/src/lib/ui.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,11 @@
328328
text-align: center;
329329
}
330330

331+
.tlui-zoom-menu__button[data-state='open']::after {
332+
background: linear-gradient(0deg, rgba(144, 144, 144, 0) 0%, var(--tl-color-muted-2) 100%);
333+
opacity: 1;
334+
}
335+
331336
/* --------------------- Layout --------------------- */
332337

333338
.tlui-layout {
@@ -789,6 +794,11 @@
789794
width: auto;
790795
}
791796

797+
.tlui-page-menu__trigger[data-state='open']::after {
798+
background: linear-gradient(180deg, rgba(144, 144, 144, 0) 0%, var(--tl-color-muted-2) 100%);
799+
opacity: 1;
800+
}
801+
792802
.tlui-page-menu__list {
793803
flex: 0 0 auto;
794804
overflow-x: hidden;

0 commit comments

Comments
 (0)