summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/shared/css/tree.css
blob: 5ea5f862d35f5c41ad4af77de30887ca76359155 (plain)
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
tree {
  outline: none;
  overflow: auto;
  display: block;
}

.tree-item > .tree-row {
  color: black;
  -webkit-user-select: none;
  border: 1px solid rgba(255,255,255,0); /* transparent white */
  background-color: rgba(255,255,255,0);
  border-radius: 2px;
  padding: 0px 3px;
  line-height: 20px;
  white-space: nowrap;
  cursor: default;
  position: relative;
  margin: -1px 0;
}

.expand-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: top;
  position: relative;
  top: 2px;
  background-image: -webkit-canvas(tree-triangle);
  background-position: 50% 50%;
  background-repeat: no-repeat;
  -webkit-transition: all .15s;
  opacity: .6;
  -webkit-transform: rotate(-90deg);
}

html[dir=rtl] .expand-icon {
  -webkit-transform: rotate(90deg);
}

.tree-item[expanded] > .tree-row > .expand-icon {
  background-image: -webkit-canvas(tree-triangle);
  -webkit-transform: rotate(0deg);
  opacity: .5;
}

.tree-row .expand-icon {
  visibility: hidden;
}

.tree-row[may-have-children] .expand-icon {
  visibility: visible;
}

.tree-row[has-children=false] .expand-icon {
  visibility: hidden;
}

.tree-row:hover {
  border-color: hsl(214, 91%, 85%);
  z-index: 1;
  background-color: hsl(214, 91%, 97%);
}

/*
  WebKit has a bug with attribute selectors so we apply selected to the tree row
  as well.

  https://bugs.webkit.org/show_bug.cgi?id=12519

*/
.tree-row[selected] {
  background-image: -webkit-gradient(linear, left top, left bottom,
      from(rgba(255,255,255,0.8)), to(rgba(255,255,255,0)));
}

.tree-row[selected] {
  border-color: hsl(0,0%,85%);
  background-color: hsl(0, 0%, 90%);
  z-index: 2;
}

.tree-row[selected]:hover,
tree:focus .tree-row[selected] {
  background-color: hsl(214, 91%, 89%);
  border-color: #7da2ce;
}

.tree-children[expanded] {
  display: block;
}

.tree-children {
  display: none;
}

.tree-item > .tree-row > * {
  display: inline-block;
  box-sizing: border-box;
}

.tree-label {
  -webkit-padding-start: 20px;
  background-image: url("../../../../../app/resources/folder_closed.png");
  background-position: 0 50%;
  background-repeat: no-repeat;
  white-space: pre;
}

/* We need to ensure that even empty labels take up space */
.tree-label:empty:after {
  content: " ";
  white-space: pre;
}

.tree-rename > .tree-row > .tree-label {
  -webkit-user-select: auto;
  -webkit-user-modify: read-write-plaintext-only;
  background: white;
  color: black;
  outline: 1px solid black;
}

html[dir=rtl] .tree-label {
  background-position: 100% 50%;
}

.tree-row[selected] > .tree-label {
  background-image: url("../../../../../app/resources/folder_open.png");
}

html[dir='rtl'] .tree-label {
  background-image: url("../../../../../app/resources/folder_closed_rtl.png");
}

html[dir='rtl'] .tree-row[selected] > .tree-label {
  background-image: url("../../../../../app/resources/folder_open_rtl.png");
}

.tree-item[editing] input {
  /* Do not inherit the line-height */
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  margin: -2px -8px -2px -3px;
  padding: 1px 7px 1px 1px;
  outline: none;
}

html[dir=rtl] .tree-item[editing] input {
  margin: -2px -3px -2px -8px;
  padding: 1px 1px 1px 7px;
}