Skip to content

Commit 5481602

Browse files
fix(ui): smooth border-radius transition on collapsible close (#16431)
## Summary When collapsing an array/blocks row, the bottom border-radius on the header would snap to rounded immediately while the content was still animating closed—creating a jarring visual disconnect between the header and the disappearing content below it. This adds a CSS keyframe animation that waits for the content to finish collapsing (300ms), then smoothly eases the corners to rounded over 150ms. The `animation-fill-mode: both` ensures the corners stay flat during the delay period. Opening remains instant so the header connects seamlessly with the expanding content. ### Before https://github.com/user-attachments/assets/b0ac0132-3883-4818-9179-d2d9a748216c ### After https://github.com/user-attachments/assets/37b3ff54-cc31-455a-8fa5-114dd1d08bb0
1 parent db1b2a8 commit 5481602

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

  • packages/ui/src/elements/Collapsible

packages/ui/src/elements/Collapsible/index.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,22 @@
109109
border-radius: var(--radius-medium) var(--radius-medium) 0 0;
110110
}
111111

112+
/* When collapsed, animate border-radius after content finishes closing */
113+
.collapsible--collapsed > .collapsible__toggle-wrap {
114+
animation: collapsible-round-corners 150ms ease 300ms both;
115+
}
116+
117+
@keyframes collapsible-round-corners {
118+
from {
119+
border-bottom-left-radius: 0;
120+
border-bottom-right-radius: 0;
121+
}
122+
to {
123+
border-bottom-left-radius: var(--radius-medium);
124+
border-bottom-right-radius: var(--radius-medium);
125+
}
126+
}
127+
112128
.collapsible__actions-wrap {
113129
display: flex;
114130
align-items: center;

0 commit comments

Comments
 (0)