-
Notifications
You must be signed in to change notification settings - Fork 0
/
01-accordion.html
214 lines (194 loc) · 5.46 KB
/
01-accordion.html
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap"
rel="stylesheet"
/>
<title>Accordion Component</title>
<style>
/*
SPACING SYSTEM (px)
2 / 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 80 / 96 / 128
FONT SIZE SYSTEM (px)
10 / 12 / 14 / 16 / 18 / 20 / 24 / 30 / 36 / 44 / 52 / 62 / 74 / 86 / 98
*/
/*
MAIN COLOR: #087f5b
GREY COLOR: #343a40
*/
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: "Inter", sans-serif;
color: #343a40;
line-height: 1;
}
.accordion {
width: 700px;
margin: 100px auto;
display: flex;
flex-direction: column;
gap: 24px;
}
.item {
box-shadow: 0 0 32px rgba(0, 0, 0, 0.1);
padding: 24px;
display: grid;
grid-template-columns: auto 1fr auto;
column-gap: 24px;
row-gap: 32px;
align-items: center;
}
.number,
.text {
font-size: 24px;
font-weight: 500;
/* color: #087f5b; */
}
.number {
color: #ced4da;
}
.icon {
width: 24px;
heigh: 24px;
stroke: #087f5b;
}
.hidden-box {
grid-column: 2;
display: none;
}
.hidden-box p {
line-height: 1.6;
margin-bottom: 24px;
}
.hidden-box ul {
color: #868e96;
margin-left: 20px;
display: flex;
flex-direction: column;
gap: 12px;
}
/* OPEN STATE */
.open {
border-top: 4px solid #087f5b;
}
.open .hidden-box {
display: block;
}
.open .number,
.open .text {
color: #087f5b;
}
</style>
</head>
<body>
<div class="accordion">
<div class="item">
<p class="number">01</p>
<p class="text">Where are these chairs assembled?</p>
<svg
xmlns="http://www.w3.org/2000/svg"
class="icon"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M19 9l-7 7-7-7"
/>
</svg>
<div class="hidden-box">
<p>
Lorem ipsum, dolor sit amet consectetur adipisicing elit.
Accusantium dolor at sequi obcaecati cupiditate. Voluptates
repellendus cupiditate aperiam! Incidunt amet quo neque.
</p>
<ul>
<li>Lorem ipsum, dolor sit amet consectetur adipisicing elit.</li>
<li>
Quasi accusamus corporis totam tempora suscipit ab obcaecati.
</li>
<li>Tempora, et atque officia at consequatur laborum!</li>
<li>Repudiandae praesentium illo voluptate in, atque enim.</li>
</ul>
</div>
</div>
<div class="item open">
<p class="number">02</p>
<p class="text">How long do I have to return my chair?</p>
<svg
xmlns="http://www.w3.org/2000/svg"
class="icon"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M19 9l-7 7-7-7"
/>
</svg>
<div class="hidden-box">
<p>
Lorem ipsum, dolor sit amet consectetur adipisicing elit.
Accusantium dolor at sequi obcaecati cupiditate. Voluptates
repellendus cupiditate aperiam! Incidunt amet quo neque.
</p>
<ul>
<li>Lorem ipsum, dolor sit amet consectetur adipisicing elit.</li>
<li>
Quasi accusamus corporis totam tempora suscipit ab obcaecati.
</li>
<li>Tempora, et atque officia at consequatur laborum!</li>
<li>Repudiandae praesentium illo voluptate in, atque enim.</li>
</ul>
</div>
</div>
<div class="item">
<p class="number">03</p>
<p class="text">Do you ship to countries outside the EU?</p>
<svg
xmlns="http://www.w3.org/2000/svg"
class="icon"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M19 9l-7 7-7-7"
/>
</svg>
<div class="hidden-box">
<p>
Lorem ipsum, dolor sit amet consectetur adipisicing elit.
Accusantium dolor at sequi obcaecati cupiditate. Voluptates
repellendus cupiditate aperiam! Incidunt amet quo neque.
</p>
<ul>
<li>Lorem ipsum, dolor sit amet consectetur adipisicing elit.</li>
<li>
Quasi accusamus corporis totam tempora suscipit ab obcaecati.
</li>
<li>Tempora, et atque officia at consequatur laborum!</li>
<li>Repudiandae praesentium illo voluptate in, atque enim.</li>
</ul>
</div>
</div>
</div>
</body>
</html>