|
7 | 7 | position: relative; |
8 | 8 |
|
9 | 9 | & > span { |
10 | | - display: inline-block; |
11 | | - line-height: 32px; |
12 | | - padding: 0 5px; // 4px padding + 1px border to stay on the same indent as selected |
| 10 | + display: flex; |
| 11 | + align-items: center; |
| 12 | + line-height: 30px; |
| 13 | + padding: 0 4px; // 4px padding to stay on the same indent as selected |
13 | 14 | margin-bottom: 4px; // also replaces padding to be consistent with selected divs |
14 | 15 | white-space: nowrap; |
15 | 16 | cursor: pointer; |
16 | | - |
17 | | - &::after { |
18 | | - content: ""; |
19 | | - display: inline-block; |
20 | | - margin-left: 6px; |
21 | | - border-width: 9px 5px 0; |
22 | | - border-color: #444 transparent transparent; |
23 | | - border-style: solid; |
24 | | - } |
25 | 17 | } |
26 | 18 | } |
27 | 19 |
|
28 | | -.taxonomy_open > span::after { |
| 20 | +.taxonomy > span > svg { |
29 | 21 | transform: rotate(-180deg); |
30 | 22 | } |
| 23 | +.taxonomy_open > span > svg { |
| 24 | + transform: none; |
| 25 | +} |
31 | 26 |
|
32 | 27 | .taxonomy__selected { |
33 | | - display: inline-flex; |
| 28 | + display: flex; |
34 | 29 | flex-wrap: wrap; |
| 30 | + min-height: 28px; // 24px button + 4px margin |
35 | 31 |
|
36 | 32 | div { |
37 | | - margin: 0 4px 4px 0; |
38 | | - background: #f4f4f4; |
39 | | - padding: 2px 4px; |
40 | | - border: 1px solid #d9d9d9; |
| 33 | + margin: 0 2px 4px 0; |
| 34 | + background: hsl(0, 0%, 95%); |
| 35 | + padding: 0; // all the right space should be a clickable button, so no padding |
| 36 | + padding-left: 8px; |
41 | 37 | border-radius: 4px; |
| 38 | + display: flex; |
| 39 | + align-items: center; |
42 | 40 | } |
43 | 41 |
|
44 | 42 | input[type=button] { |
45 | 43 | border: none; |
46 | 44 | background: none; |
47 | 45 | cursor: pointer; |
48 | | - padding: 6px 0 6px 12px; |
| 46 | + width: 24px; |
| 47 | + height: 24px; |
| 48 | + padding: 0; |
| 49 | + line-height: 1; |
| 50 | + font-weight: 500; |
| 51 | + font-size: 20px; |
| 52 | + color: #09f; |
49 | 53 |
|
50 | 54 | &:hover { |
51 | 55 | color: red; |
|
58 | 62 | z-index: 10; |
59 | 63 | background: white; |
60 | 64 | border-radius: 6px; |
61 | | - padding: 8px; |
62 | 65 | max-height: 60vh; |
63 | 66 | overflow-y: auto; |
64 | 67 | left: -1px; |
65 | 68 | width: max-content; |
66 | 69 | min-width: 100%; |
67 | 70 | max-width: 50vw; // 100% is not enough |
68 | | - margin-top: 9px; // 4px padding + 1px border + 4px gap |
69 | | - box-shadow: 0 0 4px #d9d9d9; |
| 71 | + border: 1px solid #e2e2e2; |
| 72 | + box-shadow: 0 4px 10px rgb(0 0 0 / 12%); |
70 | 73 |
|
71 | 74 | input[type=checkbox] { |
72 | 75 | margin-right: 4px; |
|
85 | 88 |
|
86 | 89 | .taxonomy__search { |
87 | 90 | width: 100%; |
88 | | - border: 1px solid #d9d9d9; |
89 | | - border-radius: 3px; |
| 91 | + border: none; |
| 92 | + border-bottom: 1px solid #e2e2e2; |
| 93 | + border-radius: 3px 3px 0 0; |
90 | 94 | padding: 6px 16px; |
91 | 95 | margin-bottom: 4px; |
92 | 96 | box-shadow: 0 -2px 0 6px white; // white background over scrolled items |
93 | 97 | position: sticky; |
94 | 98 | top: 0; |
95 | 99 | z-index: 1; |
| 100 | + |
| 101 | + &:focus, |
| 102 | + &:focus-visible { |
| 103 | + outline: 1px solid #09f; |
| 104 | + border-bottom-color: #09f; |
| 105 | + } |
96 | 106 | } |
97 | 107 |
|
98 | 108 | .taxonomy__item ~ div { |
|
106 | 116 | &:focus-within { |
107 | 117 | background: #eee; |
108 | 118 | } |
| 119 | + |
| 120 | + &_user, |
| 121 | + &_session { |
| 122 | + font-style: italic; |
| 123 | + } |
| 124 | + |
| 125 | + &_session { |
| 126 | + color: #09f; |
| 127 | + } |
109 | 128 | } |
110 | 129 |
|
111 | 130 | .taxonomy__item label { |
112 | 131 | flex-grow: 1; |
113 | 132 | flex-shrink: 0; |
114 | 133 | line-height: 2em; |
| 134 | + padding-right: 8px; |
115 | 135 | } |
116 | 136 |
|
117 | 137 | .taxonomy__grouping { |
118 | 138 | font-family: monospace; |
119 | 139 | font-size: 16px; |
120 | 140 | display: inline-block; |
121 | | - width: 20px; |
122 | | - margin-left: -2px; |
| 141 | + width: 24px; |
| 142 | + height: 24px; |
| 143 | + margin-left: 3px; |
123 | 144 | text-align: center; |
124 | 145 | user-select: none; |
125 | 146 | flex-shrink: 0; |
126 | 147 |
|
| 148 | + svg { |
| 149 | + transition: transform 0.1s; // visible rotation of arrow |
| 150 | + } |
| 151 | + |
127 | 152 | &:not(:empty) { |
128 | 153 | cursor: pointer; |
129 | 154 | } |
130 | 155 | } |
131 | 156 |
|
| 157 | +.taxonomy__extra { |
| 158 | + margin-left: auto; |
| 159 | + opacity: 0.6; |
| 160 | + padding: 0 12px; |
| 161 | + min-width: 40px; // 24px padding + 16px width for count/dots |
| 162 | + text-align: right; |
| 163 | + |
| 164 | + &_actions { |
| 165 | + display: none; |
| 166 | + font-weight: bold; |
| 167 | + cursor: pointer; |
| 168 | + text-align: center; |
| 169 | + } |
| 170 | + |
| 171 | + .taxonomy__item:hover &_count:not(:last-child) { |
| 172 | + display: none; |
| 173 | + } |
| 174 | + .taxonomy__item:hover &_actions { |
| 175 | + display: block; |
| 176 | + } |
| 177 | +} |
| 178 | + |
| 179 | +.taxonomy__action { |
| 180 | + zoom: 1; // something to apply this class |
| 181 | +} |
| 182 | + |
| 183 | +.taxonomy__add { |
| 184 | + margin-left: 27px; // chevron 24px + 3px margin |
| 185 | + display: flex; |
| 186 | + align-items: center; |
| 187 | + opacity: 0.6; |
| 188 | + |
| 189 | + &::before { |
| 190 | + content: "+"; |
| 191 | + width: 16px; // as checkbox |
| 192 | + padding: 4px 0; |
| 193 | + text-align: center; |
| 194 | + font-size: 18px; |
| 195 | + line-height: 0; |
| 196 | + } |
| 197 | + |
| 198 | + button { |
| 199 | + flex-grow: 1; |
| 200 | + border: none; |
| 201 | + padding: 1px 4px; |
| 202 | + font-weight: normal; |
| 203 | + text-align: left; |
| 204 | + } |
| 205 | +} |
| 206 | + |
| 207 | +.taxonomy__newitem { |
| 208 | + display: flex; |
| 209 | + |
| 210 | + [name=taxonomy__add] { |
| 211 | + padding: 1px 2px; |
| 212 | + border: none; |
| 213 | + flex-grow: 1; |
| 214 | + margin-left: 45px; |
| 215 | + margin-right: 8px; |
| 216 | + font: inherit; |
| 217 | + font-style: italic; |
| 218 | + color: #09f; |
| 219 | + background: rgba(0,0,0,0.03); |
| 220 | + } |
| 221 | +} |
| 222 | + |
132 | 223 | .taxonomy__collapsable { |
133 | 224 | cursor: pointer; |
134 | 225 | } |
0 commit comments