-
Notifications
You must be signed in to change notification settings - Fork 0
/
accordion-tree.css
93 lines (66 loc) · 1.46 KB
/
accordion-tree.css
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
.accordion-tree .branch {
display: block;
cursor: pointer;
}
/* default node display = none */
.accordion-tree .leaf {
display: none;
}
.accordion-tree .branch {
display: none;
}
/* top-level node display = block */
.accordion-tree > .children > .branch {
display: block;
}
.accordion-tree > .children > .leaf {
display: block;
}
/* non-top-level node default display = none */
.accordion-tree > .children > .branch .branch {
display: none;
}
.accordion-tree > .children > .branch .leaf {
display: none;
}
/* display expanded node and its children anywhere in the tree */
.accordion-tree .expanded {
display: block;
}
.accordion-tree .expanded > .children > .branch {
display: block;
}
.accordion-tree .expanded > .children > .leaf {
display: block;
}
.accordion-tree .leaf {
padding-left: 10px;
}
.accordion-tree .caret {
display: inline-block;
vertical-align: top;
width: 0;
height: 0;
content: "";
margin: 5px;
}
.accordion-tree .caret {
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid black;
border-right: none;
}
/* down-arrow when node expanded */
.accordion-tree .expanded > * > .caret {
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid black;
border-bottom: none;
margin-left: 0px;
}
/* icon span if you want custom right- and down- arrows
by default, it's hidden
*/
.accordion-tree .icon {
display: none;
}