-
Notifications
You must be signed in to change notification settings - Fork 10
/
tree.css
106 lines (105 loc) · 3.76 KB
/
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/* simple tree */
.simple-tree {
user-select: none;
-moz-user-select: none;
}
.simple-tree>details>summary {
display: none;
}
.simple-tree a,
.simple-tree summary {
display: block;
width: fit-content;
width: -moz-fit-content;
border: solid 1px transparent;
padding: 0 2px;
outline: none;
cursor: pointer;
}
.simple-tree a {
text-decoration: none;
color: inherit;
}
.simple-tree ::-webkit-details-marker {
display: none;
}
.simple-tree summary {
list-style-type: none;
background-color: #eee;
outline: none;
}
.simple-tree.dark summary {
background-color: #444;
}
.simple-tree details>:not(details),
.simple-tree details {
position: relative;
}
.simple-tree details :not(summary) {
margin-left: 20px;
}
.simple-tree.nodots details :not(summary) {
margin-left: 12px;
}
.simple-tree details::before,
.simple-tree details>:not(details)::before {
content: '';
width: 10px;
display: block;
position: absolute;
}
.simple-tree details::before,
.simple-tree details>:not(details)::before {
background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 2 2" xmlns="http://www.w3.org/2000/svg"><g><rect x="0" y="0" width="1" height="1"/></g></svg>') left top / 2px 2px;
}
.simple-tree.dark details::before,
.simple-tree.dark details>:not(summary)::before {
background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 2 2" xmlns="http://www.w3.org/2000/svg"><g><rect x="0" y="0" width="1" height="1" fill="white"/></g></svg>');
}
.simple-tree.nodots details::before,
.simple-tree.nodots details>:not(summary)::before {
background-image: none;
}
.simple-tree details::before {
top: 0;
height: 100%;
background-repeat: repeat-y;
left: 5px;
z-index: -1;
}
.simple-tree details>:not(details)::before {
top: 8px;
height: calc(100% - 8px);
background-repeat: repeat-x;
left: -15px;
}
.simple-tree details>summary::before {
background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><g><rect x="0" y="0" width="12" height="12" fill="white" stroke="gray" stroke-width="1"/><line x1="3" y1="6" x2="9" y2="6" stroke="black" stroke-width="2"/><line x1="6" y1="3" x2="6" y2="9" stroke="black" stroke-width="2"/></g></svg>') center center / 12px 12px no-repeat;
left: -22px;
top: 2px;
width: 16px;
height: 16px;
}
.simple-tree details[open]>summary::before {
background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><title/><g><rect x="0" y="0" width="12" height="12" fill="white" stroke="gray" stroke-width="1"/><line x1="3" y1="6" x2="9" y2="6" stroke="black" stroke-width="2"/></g></svg>');
}
/* async tree */
.async-tree details[open][data-loaded=false] {
pointer-events: none;
}
.async-tree details[open][data-loaded=false]>summary::before {
background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"><g><animateTransform attributeName="transform" type="rotate" from="0 32 32" to="360 32 32" dur="1s" repeatCount="indefinite"/><circle cx="32" cy="32" r="32" fill="whitesmoke"/><path d="M 62 32 A 30 30 0 0 0 32 2" style="stroke: black; stroke-width:6; fill:none;"/></g></svg>');
}
.async-tree.black details[open][data-loaded=false]>summary::before {
background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"><g><animateTransform attributeName="transform" type="rotate" from="0 32 32" to="360 32 32" dur="1s" repeatCount="indefinite"/><circle cx="32" cy="32" r="32" fill="whitesmoke"/><path d="M 62 32 A 30 30 0 0 0 32 2" style="stroke: white; stroke-width:6; fill:none;"/></g></svg>');
}
/* select tree */
.select-tree .selected {
background-color: #beebff;
border-color: #99defd;
z-index: 1;
}
.select-tree.dark .selected {
background-color: #3a484e;
border-color: #99defd;
}