File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626
2727 }
2828
29+ // Animate content on open/close (progressive enhancement)
30+ // Outside @layer — ::details-content needs real specificity to override UA styles
31+ // Gate on ::details-content support (Safari 18.4+, Chrome 131+)
32+ @supports selector (details ::details- content) {
33+ details ::details- content {
34+ transition : opacity 0.3s ease ,
35+ content- visibility 0.3s ease allow- discrete;
36+ opacity : 0 ;
37+ }
38+
39+ details [open ]::details-content {
40+ opacity : 1 ;
41+ }
42+
43+ // Height animation where interpolate-size is supported (Chrome 129+)
44+ @supports (interpolate-size : allow- keywords) {
45+ details {
46+ interpolate-size : allow- keywords;
47+ }
48+
49+ details ::details- content {
50+ transition : height 0.3s ease , opacity 0.3s ease ,
51+ content- visibility 0.3s ease allow- discrete;
52+ height : 0 ;
53+ overflow : clip ;
54+ }
55+
56+ details [open ]::details-content {
57+ height : auto ;
58+ }
59+ }
60+ }
61+
2962}
You can’t perform that action at this time.
0 commit comments