blob: cf5ba491e622970f795294fcea160655a9efd9ff [file] [log] [blame]
Akron49bfdbf2016-11-22 21:47:33 +01001@charset "utf-8";
2@import "../util";
3
Akron7e5afce2020-08-25 15:50:19 +02004/**
5 * Styles for the KWIC view.
6 */
7
Akron08b82d62016-12-05 15:06:05 +01008$font-size: 10pt;
Akron49bfdbf2016-11-22 21:47:33 +01009
10#search {
Akron7e5afce2020-08-25 15:50:19 +020011 position: relative;
Akron49bfdbf2016-11-22 21:47:33 +010012 margin-bottom: 30px;
Akron7e5afce2020-08-25 15:50:19 +020013 overflow: visible;
Akron49bfdbf2016-11-22 21:47:33 +010014
Akron7e5afce2020-08-25 15:50:19 +020015 div.matchinfo {
16 display: none;
17 }
Akron49bfdbf2016-11-22 21:47:33 +010018
Akron7e5afce2020-08-25 15:50:19 +020019 > 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;
Akronf74cd2e2018-08-15 16:26:18 +020029
Akron7e5afce2020-08-25 15:50:19 +020030 > 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 }
Akronf74cd2e2018-08-15 16:26:18 +020042
Akron7e5afce2020-08-25 15:50:19 +020043 // 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;
Akronf74cd2e2018-08-15 16:26:18 +020056 }
57
Akron7e5afce2020-08-25 15:50:19 +020058 div.meta,
59 div.match-main {
60 position: relative;
61 cursor: pointer;
Akron46b9f212017-05-01 13:55:17 +020062 }
Akron7e5afce2020-08-25 15:50:19 +020063
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 }
Akron46b9f212017-05-01 13:55:17 +020078 }
Akron7e5afce2020-08-25 15:50:19 +020079
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 }
Akron08b82d62016-12-05 15:06:05 +0100117 }
Akron7e5afce2020-08-25 15:50:19 +0200118
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 }
Akron08b82d62016-12-05 15:06:05 +0100126 }
Akron49bfdbf2016-11-22 21:47:33 +0100127 }
128}
129
Akron49bfdbf2016-11-22 21:47:33 +0100130
Akron7e5afce2020-08-25 15:50:19 +0200131/**
132 * Snippet rules
Akron49bfdbf2016-11-22 21:47:33 +0100133 */
Akron49bfdbf2016-11-22 21:47:33 +0100134div.snippet {
135 text-overflow: ellipsis;
Akron7e5afce2020-08-25 15:50:19 +0200136 text-indent: 0;
137 text-shadow: $light-shadow;
138 font-size: 0;
139 white-space: nowrap !important;
Akronf74cd2e2018-08-15 16:26:18 +0200140
Akron49bfdbf2016-11-22 21:47:33 +0100141 > span, mark {
Akron7e5afce2020-08-25 15:50:19 +0200142 padding: 5pt 0 6pt 0;
Akron2b75b132018-08-13 09:47:47 +0200143 font-size: $font-size;
Akron49bfdbf2016-11-22 21:47:33 +0100144 }
Akron7e5afce2020-08-25 15:50:19 +0200145
146 > mark,
147 > span.match {
Akron49bfdbf2016-11-22 21:47:33 +0100148 font-weight: bold;
Akron08b82d62016-12-05 15:06:05 +0100149 color: $black;
150 text-shadow: none;
Akron49bfdbf2016-11-22 21:47:33 +0100151 padding-left: 4pt;
152 padding-right: 2pt;
153 }
Akron7e5afce2020-08-25 15:50:19 +0200154
Akron09e7f1f2018-05-28 14:08:14 +0200155 > span.match > span.cutted::after {
Akron7e5afce2020-08-25 15:50:19 +0200156 @include icon-font;
Akron09e7f1f2018-05-28 14:08:14 +0200157 content: $fa-cut;
Akron7e5afce2020-08-25 15:50:19 +0200158 color: $light-green;
159
Akron09e7f1f2018-05-28 14:08:14 +0200160 padding: {
Akron7e5afce2020-08-25 15:50:19 +0200161 left: 4pt;
Akron09e7f1f2018-05-28 14:08:14 +0200162 right: 4pt;
163 }
Akronb6685bb2018-02-04 00:44:47 +0100164 }
Akron86817092024-05-27 17:52:21 +0200165
Akron7e5afce2020-08-25 15:50:19 +0200166 &.startMore:before,
167 &.endMore:after {
168 content: "…";
169 padding-left: 2pt;
170 padding-right: 2pt;
Akronb6685bb2018-02-04 00:44:47 +0100171 }
Akron3bb91bc2016-12-02 16:43:17 +0100172
Akron7e5afce2020-08-25 15:50:19 +0200173 // 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;
Akron49bfdbf2016-11-22 21:47:33 +0100182 }
183}
Akron49bfdbf2016-11-22 21:47:33 +0100184
Akron8b592d42018-01-26 18:33:06 +0100185
Akron49bfdbf2016-11-22 21:47:33 +0100186/**
Akron7e5afce2020-08-25 15:50:19 +0200187 * Active rules
Akron49bfdbf2016-11-22 21:47:33 +0100188 */
Akron2a4e9af2017-12-22 15:45:22 +0100189body.no-js #search > ol > li:active,
190#search > ol > li.active,
191#search > ol > li:target {
Akron7e5afce2020-08-25 15:50:19 +0200192 position: relative;
193 display: block;
Akron2a4e9af2017-12-22 15:45:22 +0100194 background-color: $dark-orange;
Akron7e5afce2020-08-25 15:50:19 +0200195 text-align: left;
196 border-width: 2px;
Akron548ee672020-10-19 17:41:20 +0200197 white-space: normal;
Akron7e5afce2020-08-25 15:50:19 +0200198 height: auto;
199 width: auto;
200 overflow: hidden;
Akron3bb91bc2016-12-02 16:43:17 +0100201
Akron7e5afce2020-08-25 15:50:19 +0200202 div.matchinfo {
203 display: block;
Akron49bfdbf2016-11-22 21:47:33 +0100204 }
Akron7e5afce2020-08-25 15:50:19 +0200205
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 }
Akronf74cd2e2018-08-15 16:26:18 +0200213 }
214
Akron7e5afce2020-08-25 15:50:19 +0200215 .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
Akron86817092024-05-27 17:52:21 +0200224 > * {
225 background-color: transparent;
226 }
Akron7e5afce2020-08-25 15:50:19 +0200227
Akron6e026522024-06-25 14:03:17 +0200228 span.inline-marker[data-key][data-value]:not([data-value=""]) {
229 font-size: 85%;
230 text-shadow:none;
Akron86817092024-05-27 17:52:21 +0200231 font-weight: normal;
232 color: $dark-grey;
233 &::before, &::after {
234 display: inline-block !important;
235 border-width: 2px;
236 border-radius: 0;
Akron6e026522024-06-25 14:03:17 +0200237 margin: 0;
Akron86817092024-05-27 17:52:21 +0200238 padding: 0 4pt;
239 }
240 &::before {
241 color: white;
242 margin-right: 0;
243 border-top-left-radius: 5px;
244 border-bottom-left-radius: 5px;
245 border-width-right: 0;
246 background-color: $dark-orange !important;
Akron6e026522024-06-25 14:03:17 +0200247 content: attr(data-key) ':';
Akron86817092024-05-27 17:52:21 +0200248 }
249
250 &::after {
251 border-width-left: 0;
252 margin-left: 0;
Akron6e026522024-06-25 14:03:17 +0200253 margin-right: 3pt;
254 padding-left: 1pt;
Akron86817092024-05-27 17:52:21 +0200255 border-top-right-radius: 5px;
256 border-bottom-right-radius: 5px;
257 background-color: $dark-orange !important;
258 content: attr(data-value);
259 }
260 }
261
Akron7e5afce2020-08-25 15:50:19 +0200262 div.flag {
263 display: none;
264 }
265
266 margin: {
267 top: 0;
268 right: $right-view-distance;
269 bottom: 0;
270 left: 0;
271 }
272
273 > span {
274 line-height: 1.4em;
275 width: auto;
276
277 &.context-left {
278 margin-left: 0;
279 display: inline;
280 overflow: visible;
281 text-align: left;
282 width: auto;
283 }
284 }
Akron3bb91bc2016-12-02 16:43:17 +0100285 }
Akron7e5afce2020-08-25 15:50:19 +0200286
Akronbfe912c2018-07-17 19:30:52 +0200287 .button-group.button-view {
Akron3bb91bc2016-12-02 16:43:17 +0100288 display: block;
289 }
Akron7e5afce2020-08-25 15:50:19 +0200290
291 div.match-main {
292 display: block;
293 width: 100%;
294
295 div.match-wrap {
296 cursor: default;
297 min-height: 20pt;
298 background-color: $dark-orange;
299 width: 100%;
300 margin-left: 0;
301 overflow-x: visible;
Akron548ee672020-10-19 17:41:20 +0200302 white-space: normal;
Akron49bfdbf2016-11-22 21:47:33 +0100303 }
304 }
Akron49bfdbf2016-11-22 21:47:33 +0100305
Akron49bfdbf2016-11-22 21:47:33 +0100306 div.meta {
Akron97d42802016-11-26 22:45:46 +0100307 display: none;
Akron49bfdbf2016-11-22 21:47:33 +0100308 }
Akron7e5afce2020-08-25 15:50:19 +0200309
Akron49bfdbf2016-11-22 21:47:33 +0100310 p.ref {
Akron7e5afce2020-08-25 15:50:19 +0200311 display: block;
Akron9bddc842021-12-14 10:12:10 +0100312 color: $nearly-white;
313 padding: 3pt 10pt 3pt 3pt;
314 padding-right: $right-view-distance;
315 margin: 0pt;
316 width: 100%;
317 bottom: 0;
318 z-index: 30;
Akron7e5afce2020-08-25 15:50:19 +0200319
Akron9bddc842021-12-14 10:12:10 +0100320 > span.sigle {
321 font-size: 75%;
322 vertical-align: top;
323 color: $light-orange;
324 float: right;
325 }
326
327 > div.button-panel + * {
328 margin-left: .5em;
329 }
Akron49bfdbf2016-11-22 21:47:33 +0100330 }
331}
Akron49bfdbf2016-11-22 21:47:33 +0100332
Akronf74cd2e2018-08-15 16:26:18 +0200333
334/**
Akron7e5afce2020-08-25 15:50:19 +0200335 * Alignment rules
Akronf74cd2e2018-08-15 16:26:18 +0200336 */
Akron7e5afce2020-08-25 15:50:19 +0200337#search ol {
338 span.context-left {
339 display: inline-block;
340 width: 50.01%;
341 text-align: right;
Akronad739342018-08-14 13:48:14 +0200342 }
343
Akron7e5afce2020-08-25 15:50:19 +0200344 // Right aligned
345 &.align-right {
346 text-align: right;
Akronf74cd2e2018-08-15 16:26:18 +0200347
Akron7e5afce2020-08-25 15:50:19 +0200348 div.match-main span.context-right {
349 display: inline-block;
350 width: 49.915%;
Akronf74cd2e2018-08-15 16:26:18 +0200351 text-align: left;
Akron7e5afce2020-08-25 15:50:19 +0200352 }
353 }
354
355 // Center aligned
356 &.align-center {
357 div.match-main {
358 width: 100% !important;
359
360 > .match-wrap {
361 position: relative;
362 margin-left: 0;
363 }
364 }
365
366 li:not(.active) div.snippet {
367 white-space: normal;
368 text-align: center;
369 width: 100000pt;
370 margin-left: -50000pt;
371
372 span.context-left {
373 display: inline-block;
374 text-align: right;
375 width: 40000pt;
376 margin-left: 70vw;
377 }
378
379 span.context-right {
380 display: inline-block;
381 text-align: left;
382 width: 40000pt;
383 }
Akronad739342018-08-14 13:48:14 +0200384 }
385 }
386}
387
388
Akron7e5afce2020-08-25 15:50:19 +0200389/**
390 * Fix empty contexts
391 */
392#search ol span {
393 &.context-left,
394 &.context-right {
395 &:empty::after {
396 content: " ";
397 display: inline-block;
398 }
Akron01231002017-06-29 20:47:58 +0200399 }
400}
Akron49bfdbf2016-11-22 21:47:33 +0100401
Akron7e5afce2020-08-25 15:50:19 +0200402
Akron49bfdbf2016-11-22 21:47:33 +0100403/**
Akron7e5afce2020-08-25 15:50:19 +0200404 * Highlight rules
Akron49bfdbf2016-11-22 21:47:33 +0100405 */
406mark {
407 background-color: inherit;
Akron7e5afce2020-08-25 15:50:19 +0200408 color: inherit;
Akron49bfdbf2016-11-22 21:47:33 +0100409}
410
411mark > mark,
412em,
413.level-0 {
414 border-bottom-width: 2px;
415 border-bottom-style: solid;
Akron7e5afce2020-08-25 15:50:19 +0200416 padding-bottom: 0px !important;
417 font-style: normal;
Akron49bfdbf2016-11-22 21:47:33 +0100418}
419
420mark > mark > mark,
421em > em,
422.level-1 {
Akron3bb91bc2016-12-02 16:43:17 +0100423 padding-bottom: 3px !important;
Akron49bfdbf2016-11-22 21:47:33 +0100424}
425
426mark > mark > mark > mark,
427em > em > em,
428.level-2 {
Akron3bb91bc2016-12-02 16:43:17 +0100429 padding-bottom: 6px !important;
Akron49bfdbf2016-11-22 21:47:33 +0100430}
431
432
433#search > ol > li {
434 &:not(.active) mark > mark > mark > mark,
435 &:not(.active) em > em > em {
436 line-height: 180%;
437 }
438 &.active mark > mark > mark > mark,
439 &.active em > em > em {
440 line-height: 250%;
441 }
442}
443
444.class-1 { border-color: $kwic-highlight-1; }
445.class-2 { border-color: $kwic-highlight-2; }
446.class-3 { border-color: $kwic-highlight-3; }
447.class-4 { border-color: $kwic-highlight-4; }