Skip to content

Commit cef6ff5

Browse files
committed
fix(ui): smooth border-radius transition on collapsible close
Adds a delayed CSS animation for the bottom border-radius when collapsing so the corners round smoothly after the content finishes animating closed, instead of snapping immediately.
1 parent db1b2a8 commit cef6ff5

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)