Skip to content

Commit 03058a3

Browse files
committed
🎨 prevent menu text from wrapping during sidebar transition
1 parent b7eb6bb commit 03058a3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

demo/transitions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ function view(state: State): Op[] {
107107
gap: 1,
108108
},
109109
bg: state.menuOpen ? SIDEBAR_BG_OPEN : SIDEBAR_BG_CLOSED,
110+
clip: { horizontal: true },
110111
transition: {
111112
duration: 0.2,
112113
easing: "easeInOut",
@@ -118,13 +119,13 @@ function view(state: State): Op[] {
118119
if (state.menuOpen) {
119120
ops.push(
120121
open("menu-title", { layout: { height: fixed(1) } }),
121-
text("Menu", { color: HEADING }),
122+
text("Menu", { color: HEADING, wrap: 2 }),
122123
close(),
123124
);
124125
for (let item of MENU_ITEMS) {
125126
ops.push(
126127
open(`menu:${item}`, { layout: { height: fixed(1) } }),
127-
text(item, { color: item === "—" ? DIM : MENU_ITEM }),
128+
text(item, { color: item === "—" ? DIM : MENU_ITEM, wrap: 2 }),
128129
close(),
129130
);
130131
}

0 commit comments

Comments
 (0)