Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 1 | @charset "utf-8"; |
| 2 | @import "../util"; |
| 3 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 4 | /** |
| 5 | * Styles for the KWIC view. |
| 6 | */ |
| 7 | |
Akron | 08b82d6 | 2016-12-05 15:06:05 +0100 | [diff] [blame] | 8 | $font-size: 10pt; |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 9 | |
| 10 | #search { |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 11 | position: relative; |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 12 | margin-bottom: 30px; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 13 | overflow: visible; |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 14 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 15 | div.matchinfo { |
| 16 | display: none; |
| 17 | } |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 18 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 19 | > ol { |
| 20 | overflow-x: hidden; |
| 21 | overflow-y: visible; |
| 22 | width: auto; |
| 23 | text-indent: 0; |
| 24 | list-style-type: none; |
| 25 | margin: 0; |
| 26 | padding: 0; |
| 27 | border: $result-border-size solid $kwic-border; |
| 28 | font-size: $font-size; |
Akron | f74cd2e | 2018-08-15 16:26:18 +0200 | [diff] [blame] | 29 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 30 | > li { |
| 31 | display: flex; |
| 32 | flex-direction: row; |
| 33 | flex-wrap: nowrap; |
| 34 | align-items: stretch; |
| 35 | align-content: stretch; |
| 36 | |
| 37 | border: { |
| 38 | style: solid; |
| 39 | color: $dark-orange; |
| 40 | width: 0; |
| 41 | } |
Akron | f74cd2e | 2018-08-15 16:26:18 +0200 | [diff] [blame] | 42 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 43 | // Actions |
| 44 | .button-group.button-view { |
| 45 | display: none; |
| 46 | } |
| 47 | |
| 48 | // Zebra style |
| 49 | &:nth-of-type(even) div.match-main div.match-wrap { |
| 50 | background-color: $kwic-line-even; |
| 51 | } |
| 52 | |
| 53 | // References |
| 54 | p.ref { |
| 55 | display: none; |
Akron | f74cd2e | 2018-08-15 16:26:18 +0200 | [diff] [blame] | 56 | } |
| 57 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 58 | div.meta, |
| 59 | div.match-main { |
| 60 | position: relative; |
| 61 | cursor: pointer; |
Akron | 46b9f21 | 2017-05-01 13:55:17 +0200 | [diff] [blame] | 62 | } |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 63 | |
| 64 | div.match-main { |
| 65 | display: block; |
| 66 | flex: 7 0; |
| 67 | z-index: 4; |
| 68 | overflow: hidden; |
| 69 | |
| 70 | > div.match-wrap { |
| 71 | width: 99999%; |
| 72 | margin-left: -49999.5%; |
| 73 | background-color: $kwic-line-noneven; |
| 74 | overflow-x: hidden; |
| 75 | overflow-y: visible; |
| 76 | white-space: normal; |
| 77 | } |
Akron | 46b9f21 | 2017-05-01 13:55:17 +0200 | [diff] [blame] | 78 | } |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 79 | |
| 80 | div.meta { |
| 81 | flex: 1 0; |
| 82 | min-width: 12em; |
| 83 | max-width: 15em; |
| 84 | text-align: left; |
| 85 | width: 2px; |
| 86 | z-index: 5; |
| 87 | overflow-y: hidden; |
| 88 | overflow-x: hidden; |
| 89 | text-overflow: ellipsis; |
| 90 | white-space: nowrap; |
| 91 | background-color: lighten($middle-grey, 5%); |
| 92 | color: $nearly-white; |
| 93 | font-size: 75%; |
| 94 | padding: 0 5pt; |
| 95 | |
| 96 | border: { |
| 97 | color: $dark-grey; |
| 98 | style: solid; |
| 99 | width: 2px 1px 0 0; |
| 100 | } |
| 101 | |
| 102 | // Tiny hack |
| 103 | &:before { |
| 104 | content: " "; |
| 105 | display: inline-block; |
| 106 | height: 100%; |
| 107 | vertical-align: middle; |
| 108 | } |
| 109 | |
| 110 | &:empty { |
| 111 | border-width: 0 1px 0 0; |
| 112 | } |
| 113 | |
| 114 | &.flip { |
| 115 | background-color: lighten($middle-grey, 17%); |
| 116 | } |
Akron | 08b82d6 | 2016-12-05 15:06:05 +0100 | [diff] [blame] | 117 | } |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 118 | |
| 119 | &:first-of-type div.meta { |
| 120 | border-top-width: 0; |
| 121 | } |
| 122 | |
| 123 | &:last-of-type div.meta { |
| 124 | border-bottom-width: 0; |
| 125 | } |
Akron | 08b82d6 | 2016-12-05 15:06:05 +0100 | [diff] [blame] | 126 | } |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 127 | } |
| 128 | } |
| 129 | |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 130 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 131 | /** |
| 132 | * Snippet rules |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 133 | */ |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 134 | div.snippet { |
| 135 | text-overflow: ellipsis; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 136 | text-indent: 0; |
| 137 | text-shadow: $light-shadow; |
| 138 | font-size: 0; |
| 139 | white-space: nowrap !important; |
Akron | f74cd2e | 2018-08-15 16:26:18 +0200 | [diff] [blame] | 140 | |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 141 | > span, mark { |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 142 | padding: 5pt 0 6pt 0; |
Akron | 2b75b13 | 2018-08-13 09:47:47 +0200 | [diff] [blame] | 143 | font-size: $font-size; |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 144 | } |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 145 | |
| 146 | > mark, |
| 147 | > span.match { |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 148 | font-weight: bold; |
Akron | 08b82d6 | 2016-12-05 15:06:05 +0100 | [diff] [blame] | 149 | color: $black; |
| 150 | text-shadow: none; |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 151 | padding-left: 4pt; |
| 152 | padding-right: 2pt; |
| 153 | } |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 154 | |
Akron | 09e7f1f | 2018-05-28 14:08:14 +0200 | [diff] [blame] | 155 | > span.match > span.cutted::after { |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 156 | @include icon-font; |
Akron | 09e7f1f | 2018-05-28 14:08:14 +0200 | [diff] [blame] | 157 | content: $fa-cut; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 158 | color: $light-green; |
| 159 | |
Akron | 09e7f1f | 2018-05-28 14:08:14 +0200 | [diff] [blame] | 160 | padding: { |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 161 | left: 4pt; |
Akron | 09e7f1f | 2018-05-28 14:08:14 +0200 | [diff] [blame] | 162 | right: 4pt; |
| 163 | } |
Akron | b6685bb | 2018-02-04 00:44:47 +0100 | [diff] [blame] | 164 | } |
Akron | 8681709 | 2024-05-27 17:52:21 +0200 | [diff] [blame] | 165 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 166 | &.startMore:before, |
| 167 | &.endMore:after { |
| 168 | content: "…"; |
| 169 | padding-left: 2pt; |
| 170 | padding-right: 2pt; |
Akron | b6685bb | 2018-02-04 00:44:47 +0100 | [diff] [blame] | 171 | } |
Akron | 3bb91bc | 2016-12-02 16:43:17 +0100 | [diff] [blame] | 172 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 173 | // Flags |
| 174 | div.flag { |
| 175 | position: absolute; |
| 176 | height: 100%; |
| 177 | top: 0; |
| 178 | left: 0; |
| 179 | width: 11px; |
| 180 | background-color: $dark-orange; |
| 181 | border-right: 1px solid $darkest-orange; |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 182 | } |
| 183 | } |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 184 | |
Akron | 8b592d4 | 2018-01-26 18:33:06 +0100 | [diff] [blame] | 185 | |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 186 | /** |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 187 | * Active rules |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 188 | */ |
Akron | 2a4e9af | 2017-12-22 15:45:22 +0100 | [diff] [blame] | 189 | body.no-js #search > ol > li:active, |
| 190 | #search > ol > li.active, |
| 191 | #search > ol > li:target { |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 192 | position: relative; |
| 193 | display: block; |
Akron | 2a4e9af | 2017-12-22 15:45:22 +0100 | [diff] [blame] | 194 | background-color: $dark-orange; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 195 | text-align: left; |
| 196 | border-width: 2px; |
Akron | 548ee67 | 2020-10-19 17:41:20 +0200 | [diff] [blame] | 197 | white-space: normal; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 198 | height: auto; |
| 199 | width: auto; |
| 200 | overflow: hidden; |
Akron | 3bb91bc | 2016-12-02 16:43:17 +0100 | [diff] [blame] | 201 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 202 | div.matchinfo { |
| 203 | display: block; |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 204 | } |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 205 | |
| 206 | + li.active { |
| 207 | border-top: $border-size solid $light-grey; |
| 208 | padding-top: 3 * $border-size; |
| 209 | |
| 210 | .button-group.button-view { |
| 211 | padding-top: 3 * $border-size; |
| 212 | } |
Akron | f74cd2e | 2018-08-15 16:26:18 +0200 | [diff] [blame] | 213 | } |
| 214 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 215 | .snippet { |
| 216 | white-space: normal !important; |
| 217 | padding: 2pt 0 5pt 5pt; |
| 218 | background-color: $light-orange; |
| 219 | |
| 220 | span { |
| 221 | display: inline !important; |
| 222 | } |
| 223 | |
Akron | 8681709 | 2024-05-27 17:52:21 +0200 | [diff] [blame] | 224 | > * { |
| 225 | background-color: transparent; |
| 226 | } |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 227 | |
Akron | 8681709 | 2024-05-27 17:52:21 +0200 | [diff] [blame] | 228 | span.inline-marker { |
| 229 | font-weight: normal; |
| 230 | color: $dark-grey; |
| 231 | &::before, &::after { |
| 232 | display: inline-block !important; |
| 233 | border-width: 2px; |
| 234 | border-radius: 0; |
| 235 | margin: 0 3pt; |
| 236 | padding: 0 4pt; |
| 237 | } |
| 238 | &::before { |
| 239 | color: white; |
| 240 | margin-right: 0; |
| 241 | border-top-left-radius: 5px; |
| 242 | border-bottom-left-radius: 5px; |
| 243 | border-width-right: 0; |
| 244 | background-color: $dark-orange !important; |
| 245 | content: attr(data-key) ': '; |
| 246 | } |
| 247 | |
| 248 | &::after { |
| 249 | border-width-left: 0; |
| 250 | margin-left: 0; |
| 251 | padding-left: 0; |
| 252 | border-top-right-radius: 5px; |
| 253 | border-bottom-right-radius: 5px; |
| 254 | background-color: $dark-orange !important; |
| 255 | content: attr(data-value); |
| 256 | } |
| 257 | } |
| 258 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 259 | div.flag { |
| 260 | display: none; |
| 261 | } |
| 262 | |
| 263 | margin: { |
| 264 | top: 0; |
| 265 | right: $right-view-distance; |
| 266 | bottom: 0; |
| 267 | left: 0; |
| 268 | } |
| 269 | |
| 270 | > span { |
| 271 | line-height: 1.4em; |
| 272 | width: auto; |
| 273 | |
| 274 | &.context-left { |
| 275 | margin-left: 0; |
| 276 | display: inline; |
| 277 | overflow: visible; |
| 278 | text-align: left; |
| 279 | width: auto; |
| 280 | } |
| 281 | } |
Akron | 3bb91bc | 2016-12-02 16:43:17 +0100 | [diff] [blame] | 282 | } |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 283 | |
Akron | bfe912c | 2018-07-17 19:30:52 +0200 | [diff] [blame] | 284 | .button-group.button-view { |
Akron | 3bb91bc | 2016-12-02 16:43:17 +0100 | [diff] [blame] | 285 | display: block; |
| 286 | } |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 287 | |
| 288 | div.match-main { |
| 289 | display: block; |
| 290 | width: 100%; |
| 291 | |
| 292 | div.match-wrap { |
| 293 | cursor: default; |
| 294 | min-height: 20pt; |
| 295 | background-color: $dark-orange; |
| 296 | width: 100%; |
| 297 | margin-left: 0; |
| 298 | overflow-x: visible; |
Akron | 548ee67 | 2020-10-19 17:41:20 +0200 | [diff] [blame] | 299 | white-space: normal; |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 300 | } |
| 301 | } |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 302 | |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 303 | div.meta { |
Akron | 97d4280 | 2016-11-26 22:45:46 +0100 | [diff] [blame] | 304 | display: none; |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 305 | } |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 306 | |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 307 | p.ref { |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 308 | display: block; |
Akron | 9bddc84 | 2021-12-14 10:12:10 +0100 | [diff] [blame] | 309 | color: $nearly-white; |
| 310 | padding: 3pt 10pt 3pt 3pt; |
| 311 | padding-right: $right-view-distance; |
| 312 | margin: 0pt; |
| 313 | width: 100%; |
| 314 | bottom: 0; |
| 315 | z-index: 30; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 316 | |
Akron | 9bddc84 | 2021-12-14 10:12:10 +0100 | [diff] [blame] | 317 | > span.sigle { |
| 318 | font-size: 75%; |
| 319 | vertical-align: top; |
| 320 | color: $light-orange; |
| 321 | float: right; |
| 322 | } |
| 323 | |
| 324 | > div.button-panel + * { |
| 325 | margin-left: .5em; |
| 326 | } |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 327 | } |
| 328 | } |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 329 | |
Akron | f74cd2e | 2018-08-15 16:26:18 +0200 | [diff] [blame] | 330 | |
| 331 | /** |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 332 | * Alignment rules |
Akron | f74cd2e | 2018-08-15 16:26:18 +0200 | [diff] [blame] | 333 | */ |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 334 | #search ol { |
| 335 | span.context-left { |
| 336 | display: inline-block; |
| 337 | width: 50.01%; |
| 338 | text-align: right; |
Akron | ad73934 | 2018-08-14 13:48:14 +0200 | [diff] [blame] | 339 | } |
| 340 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 341 | // Right aligned |
| 342 | &.align-right { |
| 343 | text-align: right; |
Akron | f74cd2e | 2018-08-15 16:26:18 +0200 | [diff] [blame] | 344 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 345 | div.match-main span.context-right { |
| 346 | display: inline-block; |
| 347 | width: 49.915%; |
Akron | f74cd2e | 2018-08-15 16:26:18 +0200 | [diff] [blame] | 348 | text-align: left; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 349 | } |
| 350 | } |
| 351 | |
| 352 | // Center aligned |
| 353 | &.align-center { |
| 354 | div.match-main { |
| 355 | width: 100% !important; |
| 356 | |
| 357 | > .match-wrap { |
| 358 | position: relative; |
| 359 | margin-left: 0; |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | li:not(.active) div.snippet { |
| 364 | white-space: normal; |
| 365 | text-align: center; |
| 366 | width: 100000pt; |
| 367 | margin-left: -50000pt; |
| 368 | |
| 369 | span.context-left { |
| 370 | display: inline-block; |
| 371 | text-align: right; |
| 372 | width: 40000pt; |
| 373 | margin-left: 70vw; |
| 374 | } |
| 375 | |
| 376 | span.context-right { |
| 377 | display: inline-block; |
| 378 | text-align: left; |
| 379 | width: 40000pt; |
| 380 | } |
Akron | ad73934 | 2018-08-14 13:48:14 +0200 | [diff] [blame] | 381 | } |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 386 | /** |
| 387 | * Fix empty contexts |
| 388 | */ |
| 389 | #search ol span { |
| 390 | &.context-left, |
| 391 | &.context-right { |
| 392 | &:empty::after { |
| 393 | content: " "; |
| 394 | display: inline-block; |
| 395 | } |
Akron | 0123100 | 2017-06-29 20:47:58 +0200 | [diff] [blame] | 396 | } |
| 397 | } |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 398 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 399 | |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 400 | /** |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 401 | * Highlight rules |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 402 | */ |
| 403 | mark { |
| 404 | background-color: inherit; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 405 | color: inherit; |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 406 | } |
| 407 | |
| 408 | mark > mark, |
| 409 | em, |
| 410 | .level-0 { |
| 411 | border-bottom-width: 2px; |
| 412 | border-bottom-style: solid; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 413 | padding-bottom: 0px !important; |
| 414 | font-style: normal; |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 415 | } |
| 416 | |
| 417 | mark > mark > mark, |
| 418 | em > em, |
| 419 | .level-1 { |
Akron | 3bb91bc | 2016-12-02 16:43:17 +0100 | [diff] [blame] | 420 | padding-bottom: 3px !important; |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 421 | } |
| 422 | |
| 423 | mark > mark > mark > mark, |
| 424 | em > em > em, |
| 425 | .level-2 { |
Akron | 3bb91bc | 2016-12-02 16:43:17 +0100 | [diff] [blame] | 426 | padding-bottom: 6px !important; |
Akron | 49bfdbf | 2016-11-22 21:47:33 +0100 | [diff] [blame] | 427 | } |
| 428 | |
| 429 | |
| 430 | #search > ol > li { |
| 431 | &:not(.active) mark > mark > mark > mark, |
| 432 | &:not(.active) em > em > em { |
| 433 | line-height: 180%; |
| 434 | } |
| 435 | &.active mark > mark > mark > mark, |
| 436 | &.active em > em > em { |
| 437 | line-height: 250%; |
| 438 | } |
| 439 | } |
| 440 | |
| 441 | .class-1 { border-color: $kwic-highlight-1; } |
| 442 | .class-2 { border-color: $kwic-highlight-2; } |
| 443 | .class-3 { border-color: $kwic-highlight-3; } |
| 444 | .class-4 { border-color: $kwic-highlight-4; } |