-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccordion.component.scss
72 lines (61 loc) · 1.32 KB
/
accordion.component.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
@use "elx/a11y" as *;
@use "elx/anim";
@use "elx/layout";
@use "elx/style/color";
@use "elx/style/type";
.elx-accordion {
@include layout.flex(column);
}
.elx-accordion-header {
@include layout.flex(row, center);
height: calc(#{rem(16)} + 16px);
padding: 0 0 0 12px;
user-select: none;
cursor: pointer;
background: color.background(500);
color: color.foreground(200);
outline: none !important;
@include anim.transition((background, color));
&:hover {
background: color.background(600);
}
&:focus-visible {
background: color.accent(200);
color: color.foreground(50);
}
&__title {
flex: 1 0 0;
@include layout.flex(row);
@include type.h3;
color: inherit;
}
&__toolbar {
flex: 0 0 auto;
width: max-content;
}
&__icon {
@include layout.flex(row, center, center);
flex: 0 0 calc(#{rem(16)} + 20px);
height: calc(#{rem(16)} + 16px);
color: color.foreground(400);
box-shadow: inset 0 0 0 0 transparent;
@include anim.transition((color, box-shadow));
.elx-icon {
transition: transform 100ms linear;
}
&--expanded {
.elx-icon {
transform: rotateZ(90deg);
}
}
&:where(.elx-accordion-header:focus-visible #{&}) {
color: color.accent(600);
box-shadow: inset 0 0 0 2px color.accent(600);
}
}
}
.elx-accordion-body {
display: block;
overflow: hidden;
padding: 12px;
}