-
Notifications
You must be signed in to change notification settings - Fork 1
/
treegrid.css
68 lines (59 loc) · 1.62 KB
/
treegrid.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
#treegrid {
width: 100%;
white-space: nowrap;
border-collapse: collapse;
}
#treegrid th {
text-align: left;
background-color: #eee;
}
/* Extra space between columns for readability */
#treegrid th, #treegrid td {
padding-right: 2ch;
padding-bottom: 3px;
}
#treegrid :focus {
background-color: hsl(230, 60%, 40%);
color: white;
fill: white; /* For triangle color */
outline: 0;
}
/* 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 {
/*background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12'><polygon fill='black' points='2,0 2,10 10,5'></polygon></svg>") no-repeat;*/
background-image: url("row-expand-icon.svg"), url("row-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 {
background-image: url("row-expand-icon-highlighted.svg");
}
#treegrid tr[aria-expanded="true"] > td:first-child::before {
transform: rotate(90deg);
}