-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtreegrid.css
More file actions
91 lines (78 loc) · 1.96 KB
/
treegrid.css
File metadata and controls
91 lines (78 loc) · 1.96 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
#treegrid {
width: 100%;
white-space: nowrap;
border-collapse: collapse;
table-layout: fixed;
}
#treegrid tr {
cursor: default;
}
#treegrid-col1, #treegrid-col3 {
width: 30%;
}
#treegrid th {
text-align: left;
background-color: #eee;
}
/* Extra space between columns for readability */
#treegrid th, #treegrid td {
padding-bottom: 3px;
overflow-x: hidden;
text-overflow: ellipsis;
}
#treegrid tr > td:not(:first-child),
#treegrid tr > th:not(:first-child) {
padding-left: 3ch;
}
#treegrid :focus {
background-color: hsl(230, 60%, 40%);
color: white;
outline: 0;
}
#treegrid :focus a {
color: white;
}
/* Hide collapsed rows */
#treegrid tr[aria-hidden="true"] {
display: none;
}
/* Indents */
#treegrid tr[aria-level="2"] > td:first-child {
padding-left: 2.5ch;
}
#treegrid tr[aria-level="3"] > td:first-child {
padding-left: 5ch;
}
#treegrid tr[aria-level="4"] > td:first-child {
padding-left: 7.5ch;
}
#treegrid tr[aria-level="5"] > td:first-child {
padding-left: 10ch;
}
/* Collapse/expand icons */
#treegrid tr > td:first-child::before {
font-family: monospace;
content: " ";
display: inline-block;
width: 2ch;
height: 11px;
transition: transform .3s;
transform-origin: 5px 5px;
}
#treegrid tr[aria-expanded] > td:first-child::before,
#treegrid td[aria-expanded]:first-child::before {
cursor: pointer;
/* Load both right away so there is no lag when we need the other */
background-image: url("expand-icon.svg"), url("expand-icon-highlighted.svg");
background-repeat: no-repeat;
}
#treegrid tr[aria-expanded]:focus > td:first-child::before,
#treegrid tr[aria-expanded] > td:focus:first-child::before,
#treegrid tr:focus > td[aria-expanded]:first-child::before,
#treegrid tr > td[aria-expanded]:focus:first-child::before {
background-image: url("expand-icon-highlighted.svg");
}
#treegrid tr[aria-expanded="true"] > td:first-child::before,
#treegrid td[aria-expanded="true"]:first-child::before {
transform: rotate(90deg);
}