Skip to content

Commit 7e8b4cb

Browse files
committed
fix(collapsible-section): prevent nested sections to remain open after collapsing
1 parent 9f335f5 commit 7e8b4cb

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/components/collapsible-section/collapsible-section.scss

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,26 @@ limel-icon {
152152
// from `0` to `auto`
153153
.body {
154154
transition: grid-template-rows
155-
var(--limel-cs-grid-template-rows-transition-speed, 0.3s)
155+
var(--limel-cs-grid-template-rows-transition-speed)
156156
cubic-bezier(1, 0.09, 0, 0.89);
157157
display: grid;
158-
grid-template-rows: var(--limel-cs-grid-template-rows, 0fr);
158+
grid-template-rows: var(--limel-cs-grid-template-rows);
159159

160160
slot {
161-
transition: opacity var(--limel-cs-opacity-transition-speed, 0.1s) ease
162-
var(--limel-cs-opacity-transition-delay, 0s);
161+
transition: opacity var(--limel-cs-opacity-transition-speed) ease
162+
var(--limel-cs-opacity-transition-delay);
163163
display: block;
164164
overflow: hidden;
165+
}
166+
}
167+
168+
:host(limel-collapsible-section:not([is-open])) {
169+
--limel-cs-opacity-transition-speed: 0.1s;
170+
--limel-cs-opacity-transition-delay: 0s;
171+
--limel-cs-grid-template-rows-transition-speed: 0.3s;
172+
--limel-cs-grid-template-rows: 0fr;
173+
174+
slot {
165175
opacity: 0;
166176
}
167177
}

0 commit comments

Comments
 (0)