-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathaccordion.less
63 lines (58 loc) · 1020 Bytes
/
accordion.less
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
.accordionjs{
position: relative;
margin: 0;
padding: 0;
list-style: none;
margin-top: 10px;
margin-bottom: 20px;
// Section
// ---------------
.acc_section{
border: 1px solid #ccc;
position: relative;
z-index: 10;
margin-top: -1px;
overflow: hidden;
// Head
// ------------
.acc_head{
position: relative;
background: #fff;
padding: 10px;
display: block;
cursor: pointer;
h3{
line-height: 1;
margin: 5px 0;
}
}
// Content
// ---------------
.acc_content{
padding: 10px;
}
// General rules
// ---------------------
// Border radius
&:first-of-type,
&:first-of-type .acc_head{
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
&:last-of-type,
&:last-of-type .acc_content{
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
}
//JS Requirements
&.acc_active{
> .acc_content{
display: block;
}
> .acc_head{
background: #F9F9F9;
border-bottom: 1px solid #ccc;
}
}
}
}