Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

pdfViewer.css

52 lines1.5 KB

1/* TextLayer geometry follows PDF.js' text layer contract (Apache-2.0). */
2[data-pdf-text-layer] {
3 position: absolute;
4 inset: 0;
5 overflow: clip;
6 line-height: 1;
7 text-align: initial;
8 letter-spacing: normal;
9 word-spacing: normal;
10 text-size-adjust: none;
11 forced-color-adjust: none;
12 transform-origin: 0 0;
13 --min-font-size: 1;
14 --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
15 --min-font-size-inv: calc(1 / var(--min-font-size));
16 --scale-round-x: 1px;
17 --scale-round-y: 1px;
19[data-pdf-text-layer][data-main-rotation="90"] {
20 transform: rotate(90deg) translateY(-100%);
22[data-pdf-text-layer][data-main-rotation="180"] {
23 transform: rotate(180deg) translate(-100%, -100%);
25[data-pdf-text-layer][data-main-rotation="270"] {
26 transform: rotate(270deg) translateX(-100%);
28[data-pdf-text-layer] :is(span, br) {
29 color: transparent;
30 position: absolute;
31 white-space: pre;
32 cursor: text;
33 transform-origin: 0 0;
34 user-select: text;
36[data-pdf-text-layer] > :not(.markedContent),
37[data-pdf-text-layer] .markedContent span:not(.markedContent) {
38 --font-height: 0;
39 --scale-x: 1;
40 --rotate: 0deg;
41 font-size: calc(var(--text-scale-factor) * var(--font-height));
42 transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));
44[data-pdf-text-layer] .markedContent {
45 display: contents;
47[data-pdf-text-layer] ::selection {
48 background: #4a90e266;
50[data-pdf-text-layer] .pdf-find-match {
51 background: #ffc80066;