Debian Codegraph @

src/foliate-js/vendor/pdfjs/annotation_layer_builder.css

raw
1 /* Copyright 2014 Mozilla Foundation
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 .annotationLayer {
17 --annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");
18 --input-focus-border-color: Highlight;
19 --input-focus-outline: 1px solid Canvas;
20 --input-unfocused-border-color: transparent;
21 --input-disabled-border-color: transparent;
22 --input-hover-border-color: black;
23 --link-outline: none;
24
25 @media screen and (forced-colors: active) {
26 --input-focus-border-color: CanvasText;
27 --input-unfocused-border-color: ActiveText;
28 --input-disabled-border-color: GrayText;
29 --input-hover-border-color: Highlight;
30 --link-outline: 1.5px solid LinkText;
31
32 .textWidgetAnnotation :is(input, textarea):required,
33 .choiceWidgetAnnotation select:required,
34 .buttonWidgetAnnotation:is(.checkBox, .radioButton) input:required {
35 outline: 1.5px solid selectedItem;
36 }
37
38 .linkAnnotation {
39 outline: var(--link-outline);
40
41 &:hover {
42 backdrop-filter: var(--hcm-highlight-filter);
43 }
44
45 & > a:hover {
46 opacity: 0 !important;
47 background: none !important;
48 box-shadow: none;
49 }
50 }
51
52 .popupAnnotation .popup {
53 outline: calc(1.5px * var(--scale-factor)) solid CanvasText !important;
54 background-color: ButtonFace !important;
55 color: ButtonText !important;
56 }
57
58 .highlightArea:hover::after {
59 position: absolute;
60 top: 0;
61 left: 0;
62 width: 100%;
63 height: 100%;
64 backdrop-filter: var(--hcm-highlight-filter);
65 content: "";
66 pointer-events: none;
67 }
68
69 .popupAnnotation.focused .popup {
70 outline: calc(3px * var(--scale-factor)) solid Highlight !important;
71 }
72 }
73
74 position: absolute;
75 top: 0;
76 left: 0;
77 pointer-events: none;
78 transform-origin: 0 0;
79
80 &[data-main-rotation="90"] .norotate {
81 transform: rotate(270deg) translateX(-100%);
82 }
83 &[data-main-rotation="180"] .norotate {
84 transform: rotate(180deg) translate(-100%, -100%);
85 }
86 &[data-main-rotation="270"] .norotate {
87 transform: rotate(90deg) translateY(-100%);
88 }
89
90 &.disabled {
91 section,
92 .popup {
93 pointer-events: none;
94 }
95 }
96
97 .annotationContent {
98 position: absolute;
99 width: 100%;
100 height: 100%;
101 pointer-events: none;
102
103 &.freetext {
104 background: transparent;
105 border: none;
106 inset: 0;
107 overflow: visible;
108 white-space: nowrap;
109 font: 10px sans-serif;
110 line-height: 1.35;
111 user-select: none;
112 }
113 }
114
115 section {
116 position: absolute;
117 text-align: initial;
118 pointer-events: auto;
119 box-sizing: border-box;
120 transform-origin: 0 0;
121
122 &:has(div.annotationContent) {
123 canvas.annotationContent {
124 display: none;
125 }
126 }
127 }
128
129 .textLayer.selecting ~ & section {
130 pointer-events: none;
131 }
132
133 :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton) > a {
134 position: absolute;
135 font-size: 1em;
136 top: 0;
137 left: 0;
138 width: 100%;
139 height: 100%;
140 }
141
142 :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton):not(.hasBorder)
143 > a:hover {
144 opacity: 0.2;
145 background-color: rgb(255 255 0);
146 box-shadow: 0 2px 10px rgb(255 255 0);
147 }
148
149 .linkAnnotation.hasBorder:hover {
150 background-color: rgb(255 255 0 / 0.2);
151 }
152
153 .hasBorder {
154 background-size: 100% 100%;
155 }
156
157 .textAnnotation img {
158 position: absolute;
159 cursor: pointer;
160 width: 100%;
161 height: 100%;
162 top: 0;
163 left: 0;
164 }
165
166 .textWidgetAnnotation :is(input, textarea),
167 .choiceWidgetAnnotation select,
168 .buttonWidgetAnnotation:is(.checkBox, .radioButton) input {
169 background-image: var(--annotation-unfocused-field-background);
170 border: 2px solid var(--input-unfocused-border-color);
171 box-sizing: border-box;
172 font: calc(9px * var(--scale-factor)) sans-serif;
173 height: 100%;
174 margin: 0;
175 vertical-align: top;
176 width: 100%;
177 }
178
179 .textWidgetAnnotation :is(input, textarea):required,
180 .choiceWidgetAnnotation select:required,
181 .buttonWidgetAnnotation:is(.checkBox, .radioButton) input:required {
182 outline: 1.5px solid red;
183 }
184
185 .choiceWidgetAnnotation select option {
186 padding: 0;
187 }
188
189 .buttonWidgetAnnotation.radioButton input {
190 border-radius: 50%;
191 }
192
193 .textWidgetAnnotation textarea {
194 resize: none;
195 }
196
197 .textWidgetAnnotation :is(input, textarea)[disabled],
198 .choiceWidgetAnnotation select[disabled],
199 .buttonWidgetAnnotation:is(.checkBox, .radioButton) input[disabled] {
200 background: none;
201 border: 2px solid var(--input-disabled-border-color);
202 cursor: not-allowed;
203 }
204
205 .textWidgetAnnotation :is(input, textarea):hover,
206 .choiceWidgetAnnotation select:hover,
207 .buttonWidgetAnnotation:is(.checkBox, .radioButton) input:hover {
208 border: 2px solid var(--input-hover-border-color);
209 }
210 .textWidgetAnnotation :is(input, textarea):hover,
211 .choiceWidgetAnnotation select:hover,
212 .buttonWidgetAnnotation.checkBox input:hover {
213 border-radius: 2px;
214 }
215
216 .textWidgetAnnotation :is(input, textarea):focus,
217 .choiceWidgetAnnotation select:focus {
218 background: none;
219 border: 2px solid var(--input-focus-border-color);
220 border-radius: 2px;
221 outline: var(--input-focus-outline);
222 }
223
224 .buttonWidgetAnnotation:is(.checkBox, .radioButton) :focus {
225 background-image: none;
226 background-color: transparent;
227 }
228
229 .buttonWidgetAnnotation.checkBox :focus {
230 border: 2px solid var(--input-focus-border-color);
231 border-radius: 2px;
232 outline: var(--input-focus-outline);
233 }
234
235 .buttonWidgetAnnotation.radioButton :focus {
236 border: 2px solid var(--input-focus-border-color);
237 outline: var(--input-focus-outline);
238 }
239
240 .buttonWidgetAnnotation.checkBox input:checked::before,
241 .buttonWidgetAnnotation.checkBox input:checked::after,
242 .buttonWidgetAnnotation.radioButton input:checked::before {
243 background-color: CanvasText;
244 content: "";
245 display: block;
246 position: absolute;
247 }
248
249 .buttonWidgetAnnotation.checkBox input:checked::before,
250 .buttonWidgetAnnotation.checkBox input:checked::after {
251 height: 80%;
252 left: 45%;
253 width: 1px;
254 }
255
256 .buttonWidgetAnnotation.checkBox input:checked::before {
257 transform: rotate(45deg);
258 }
259
260 .buttonWidgetAnnotation.checkBox input:checked::after {
261 transform: rotate(-45deg);
262 }
263
264 .buttonWidgetAnnotation.radioButton input:checked::before {
265 border-radius: 50%;
266 height: 50%;
267 left: 25%;
268 top: 25%;
269 width: 50%;
270 }
271
272 .textWidgetAnnotation input.comb {
273 font-family: monospace;
274 padding-left: 2px;
275 padding-right: 0;
276 }
277
278 .textWidgetAnnotation input.comb:focus {
279 /*
280 * Letter spacing is placed on the right side of each character. Hence, the
281 * letter spacing of the last character may be placed outside the visible
282 * area, causing horizontal scrolling. We avoid this by extending the width
283 * when the element has focus and revert this when it loses focus.
284 */
285 width: 103%;
286 }
287
288 .buttonWidgetAnnotation:is(.checkBox, .radioButton) input {
289 appearance: none;
290 }
291
292 .fileAttachmentAnnotation .popupTriggerArea {
293 height: 100%;
294 width: 100%;
295 }
296
297 .popupAnnotation {
298 position: absolute;
299 font-size: calc(9px * var(--scale-factor));
300 pointer-events: none;
301 width: max-content;
302 max-width: 45%;
303 height: auto;
304 }
305
306 .popup {
307 background-color: rgb(255 255 153);
308 box-shadow: 0 calc(2px * var(--scale-factor))
309 calc(5px * var(--scale-factor)) rgb(136 136 136);
310 border-radius: calc(2px * var(--scale-factor));
311 outline: 1.5px solid rgb(255 255 74);
312 padding: calc(6px * var(--scale-factor));
313 cursor: pointer;
314 font: message-box;
315 white-space: normal;
316 word-wrap: break-word;
317 pointer-events: auto;
318 }
319
320 .popupAnnotation.focused .popup {
321 outline-width: 3px;
322 }
323
324 .popup * {
325 font-size: calc(9px * var(--scale-factor));
326 }
327
328 .popup > .header {
329 display: inline-block;
330 }
331
332 .popup > .header h1 {
333 display: inline;
334 }
335
336 .popup > .header .popupDate {
337 display: inline-block;
338 margin-left: calc(5px * var(--scale-factor));
339 width: fit-content;
340 }
341
342 .popupContent {
343 border-top: 1px solid rgb(51 51 51);
344 margin-top: calc(2px * var(--scale-factor));
345 padding-top: calc(2px * var(--scale-factor));
346 }
347
348 .richText > * {
349 white-space: pre-wrap;
350 font-size: calc(9px * var(--scale-factor));
351 }
352
353 .popupTriggerArea {
354 cursor: pointer;
355 }
356
357 section svg {
358 position: absolute;
359 width: 100%;
360 height: 100%;
361 top: 0;
362 left: 0;
363 }
364
365 .annotationTextContent {
366 position: absolute;
367 width: 100%;
368 height: 100%;
369 opacity: 0;
370 color: transparent;
371 user-select: none;
372 pointer-events: none;
373
374 span {
375 width: 100%;
376 display: inline-block;
377 }
378 }
379
380 svg.quadrilateralsContainer {
381 contain: strict;
382 width: 0;
383 height: 0;
384 position: absolute;
385 top: 0;
386 left: 0;
387 z-index: -1;
388 }
389 }