-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccordion.css
More file actions
128 lines (128 loc) · 2.98 KB
/
accordion.css
File metadata and controls
128 lines (128 loc) · 2.98 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
@layer aw-components {
.aw-accordion {
--aw-bg: #fff;
--aw-text: #0f172a;
--aw-text-muted: #64748b;
--aw-hover-bg: #f1f5f9;
--aw-active-bg: #eff6ff;
--aw-active-text: #1d4ed8;
--aw-border: #e2e8f0;
--aw-radius: 6px;
--aw-font: system-ui, -apple-system, sans-serif;
--aw-transition: 150ms ease;
--aw-ring-color: #93c5fd;
font-family: var(--aw-font);
color: var(--aw-text);
max-width: 320px;
width: 100%;
}
.aw-search {
display: block;
width: 100%;
padding: 8px 12px;
font-size: 14px;
font-family: inherit;
color: var(--aw-text);
background: var(--aw-bg);
border: 1px solid var(--aw-border);
border-radius: var(--aw-radius);
outline: none;
transition: border-color var(--aw-transition), box-shadow var(--aw-transition);
box-sizing: border-box;
}
.aw-search:focus {
border-color: var(--aw-ring-color);
box-shadow: 0 0 0 3px color-mix(in srgb, var(--aw-ring-color) 30%, transparent);
}
.aw-search::placeholder {
color: var(--aw-text-muted);
}
.aw-divider {
margin: 8px 0;
border: none;
border-top: 1px solid var(--aw-border);
}
.aw-item {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
padding: 10px 12px;
font-size: 14px;
font-family: inherit;
color: var(--aw-text);
background: transparent;
border: none;
border-radius: var(--aw-radius);
cursor: pointer;
text-align: left;
text-decoration: none;
outline: none;
transition: background var(--aw-transition);
box-sizing: border-box;
}
.aw-item:hover {
background: var(--aw-hover-bg);
}
.aw-item:focus-visible {
box-shadow: inset 0 0 0 2px var(--aw-ring-color);
}
.aw-item[aria-expanded='true'] {
font-weight: 600;
}
.aw-item-inner {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
}
.aw-item-icon {
display: flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
flex-shrink: 0;
color: var(--aw-text-muted);
}
.aw-chevron {
flex-shrink: 0;
color: var(--aw-text-muted);
transition: transform var(--aw-transition);
}
.aw-group:has([aria-expanded='true']) > .aw-item > .aw-chevron {
transform: rotate(180deg);
}
.aw-children {
padding-inline-start: 8px;
animation: aw-slide-down var(--aw-transition);
}
@keyframes aw-slide-down {
from {
opacity: 0;
transform: translateY(-4px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.aw-empty {
padding: 16px 12px;
text-align: center;
color: var(--aw-text-muted);
font-size: 14px;
}
@media (prefers-color-scheme: dark) {
.aw-accordion {
--aw-bg: #1e293b;
--aw-text: #f1f5f9;
--aw-text-muted: #94a3b8;
--aw-hover-bg: #334155;
--aw-active-bg: #1e3a5f;
--aw-active-text: #93c5fd;
--aw-border: #475569;
--aw-ring-color: #60a5fa;
}
}
}