Skip to content

Commit a36b5d2

Browse files
authored
[6.0] Atum - add nice transition to open/close details (#45794)
* add nice transition to open/close details * solve jumpy closing by replacing margin-top by padding-top * solve lint issue. change order
1 parent dd3d8fc commit a36b5d2

File tree

1 file changed

+21
-2
lines changed
  • build/media_source/templates/administrator/atum/scss/blocks

1 file changed

+21
-2
lines changed

build/media_source/templates/administrator/atum/scss/blocks/_global.scss

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,19 +230,38 @@ a[target="_blank"]::before {
230230
}
231231

232232
// details
233-
234233
details {
234+
--_duration: .2s;
235+
235236
padding: .5rem 1rem;
236237
margin: 0 0 2rem;
237238
background: $details-bg;
238239
border: $details-border;
239240
border-radius: $border-radius;
240241

242+
@media (prefers-reduced-motion: no-preference) {
243+
interpolate-size: allow-keywords;
244+
}
245+
246+
&::details-content {
247+
overflow-y: clip;
248+
opacity: 0;
249+
block-size: 0;
250+
transition: content-visibility var(--_duration) allow-discrete,
251+
opacity var(--_duration),
252+
block-size var(--_duration);
253+
}
254+
255+
&[open]::details-content {
256+
opacity: 1;
257+
block-size: auto;
258+
}
259+
241260
summary {
242261
color: var(--template-link-color);
243262

244263
~ * {
245-
margin-top: 1rem;
264+
padding-top: 1rem;
246265
}
247266
}
248267
}

0 commit comments

Comments
 (0)