Skip to content

Commit f87e820

Browse files
committed
refactor: remove unnecessary @layer wrapper from collapsible mixin
1 parent 1d57d22 commit f87e820

File tree

1 file changed

+46
-48
lines changed

1 file changed

+46
-48
lines changed
Lines changed: 46 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,65 @@
11
/* For animation technique see https://css-tricks.com/css-grid-can-do-auto-height-transitions/ */
22

3-
@layer kol-component {
4-
.collapsible {
5-
@media (prefers-reduced-motion) {
6-
&__wrapper-animation,
7-
&__wrapper {
8-
transition: none !important;
9-
}
3+
.collapsible {
4+
@media (prefers-reduced-motion) {
5+
&__wrapper-animation,
6+
&__wrapper {
7+
transition: none !important;
108
}
9+
}
1110

12-
/* @see https://github.com/public-ui/kolibri/issues/5952 */
13-
@media print {
14-
:not(.collapsible--open) &__wrapper-animation {
15-
display: none;
16-
}
17-
}
18-
&__wrapper {
19-
/* Forces the element into its own GPU compositing layer (via 3D transform). Helps prevent rendering/layout bugs (e.g. #7511) and may improve animation performance. */
20-
transform: translateZ(0);
21-
display: grid;
22-
grid-template-rows: 0fr;
23-
transition: grid-template-rows 0.3s;
11+
/* @see https://github.com/public-ui/kolibri/issues/5952 */
12+
@media print {
13+
:not(.collapsible--open) &__wrapper-animation {
14+
display: none;
2415
}
16+
}
17+
&__wrapper {
18+
/* Forces the element into its own GPU compositing layer (via 3D transform). Helps prevent rendering/layout bugs (e.g. #7511) and may improve animation performance. */
19+
transform: translateZ(0);
20+
display: grid;
21+
grid-template-rows: 0fr;
22+
transition: grid-template-rows 0.3s;
23+
}
2524

26-
&__wrapper-animation {
27-
opacity: 0;
28-
transform: scaleY(0);
29-
transform-origin: top;
30-
min-height: 0;
25+
&__wrapper-animation {
26+
opacity: 0;
27+
transform: scaleY(0);
28+
transform-origin: top;
29+
min-height: 0;
3130

32-
/* This property is important to keep in sync with the visual transition (template-rows). Without it interactive elements within the accordion would stay focusable. */
33-
visibility: hidden;
31+
/* This property is important to keep in sync with the visual transition (template-rows). Without it interactive elements within the accordion would stay focusable. */
32+
visibility: hidden;
3433

35-
transition:
36-
transform 0.3s,
37-
opacity 0.3s,
38-
visibility 0.3s;
39-
}
34+
transition:
35+
transform 0.3s,
36+
opacity 0.3s,
37+
visibility 0.3s;
38+
}
4039

41-
&--open &__wrapper {
42-
grid-template-rows: 1fr;
43-
}
40+
&--open &__wrapper {
41+
grid-template-rows: 1fr;
42+
}
4443

45-
&--open &__wrapper-animation {
46-
opacity: 1;
47-
transform: scaleY(1);
44+
&--open &__wrapper-animation {
45+
opacity: 1;
46+
transform: scaleY(1);
4847

49-
visibility: visible;
50-
}
48+
visibility: visible;
49+
}
5150

52-
/*
51+
/*
5352
* Inside a button, the caption text is always centered.
5453
* So we have to align the text to the left.
5554
*/
56-
&__heading-button button {
57-
.kol-span {
58-
align-items: flex-start;
59-
}
55+
&__heading-button button {
56+
.kol-span {
57+
align-items: flex-start;
6058
}
6159
}
60+
}
6261

63-
.collapsible--open:focus-within {
64-
position: relative;
65-
z-index: 100;
66-
}
62+
.collapsible--open:focus-within {
63+
position: relative;
64+
z-index: 100;
6765
}

0 commit comments

Comments
 (0)