This commit is contained in:
2026-01-28 16:46:07 +00:00
parent b97601a876
commit 7e50b8cb3f
3 changed files with 208 additions and 2 deletions

View File

@@ -276,6 +276,7 @@ export const viewerStyles = [
border-radius: 4px;
overflow: hidden;
display: inline-block;
position: relative;
}
.page-canvas {
@@ -284,6 +285,48 @@ export const viewerStyles = [
image-rendering: crisp-edges;
}
/* Text layer for selection */
.text-layer {
position: absolute;
inset: 0;
overflow: clip;
line-height: 1;
text-size-adjust: none;
forced-color-adjust: none;
transform-origin: 0 0;
z-index: 1;
}
.text-layer span,
.text-layer br {
color: transparent;
position: absolute;
white-space: pre;
cursor: text;
transform-origin: 0% 0%;
}
.text-layer ::selection {
background: rgba(0, 100, 200, 0.3);
}
.text-layer br::selection {
background: transparent;
}
.text-layer .endOfContent {
display: block;
position: absolute;
inset: 100% 0 0;
z-index: 0;
cursor: default;
user-select: none;
}
.text-layer.selecting .endOfContent {
top: 0;
}
.pdf-viewer.with-sidebar .viewer-main {
margin-left: 0;
}