pdf.js/web/text_layer_builder.css

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

121 lines
2.8 KiB
CSS
Raw Permalink Normal View History

/* Copyright 2014 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.textLayer {
position: absolute;
text-align: initial;
inset: 0;
overflow: hidden;
opacity: 1;
line-height: 1;
text-size-adjust: none;
forced-color-adjust: none;
transform-origin: 0 0;
z-index: 2;
caret-color: CanvasText;
&.highlighting {
touch-action: none;
}
2023-10-28 00:38:01 +09:00
:is(span, br) {
color: transparent;
position: absolute;
white-space: pre;
cursor: text;
transform-origin: 0% 0%;
}
2023-10-28 00:38:01 +09:00
/* Only necessary in Google Chrome, see issue 14205, and most unfortunately
* the problem doesn't show up in "text" reference tests. */
/*#if !MOZCENTRAL*/
span.markedContent {
top: 0;
height: 0;
}
/*#endif*/
2023-10-28 00:38:01 +09:00
.highlight {
--highlight-bg-color: rgb(180 0 170 / 0.25);
--highlight-selected-bg-color: rgb(0 100 0 / 0.25);
--highlight-backdrop-filter: none;
--highlight-selected-backdrop-filter: none;
2023-10-28 00:38:01 +09:00
@media screen and (forced-colors: active) {
--highlight-bg-color: transparent;
--highlight-selected-bg-color: transparent;
--highlight-backdrop-filter: var(--hcm-highlight-filter);
--highlight-selected-backdrop-filter: var(
--hcm-highlight-selected-filter
);
2023-10-28 00:38:01 +09:00
}
2023-10-28 00:38:01 +09:00
margin: -1px;
padding: 1px;
background-color: var(--highlight-bg-color);
backdrop-filter: var(--highlight-backdrop-filter);
2023-10-28 00:38:01 +09:00
border-radius: 4px;
2023-10-28 00:38:01 +09:00
&.appended {
position: initial;
}
2023-10-28 00:38:01 +09:00
&.begin {
border-radius: 4px 0 0 4px;
}
2023-10-28 00:38:01 +09:00
&.end {
border-radius: 0 4px 4px 0;
}
&.middle {
border-radius: 0;
}
&.selected {
background-color: var(--highlight-selected-bg-color);
backdrop-filter: var(--highlight-selected-backdrop-filter);
2023-10-28 00:38:01 +09:00
}
}
::selection {
/*#if !MOZCENTRAL*/
background: rgba(0 0 255 / 0.25);
2023-10-28 00:38:01 +09:00
/*#endif*/
/* stylelint-disable-next-line declaration-block-no-duplicate-properties */
background: color-mix(in srgb, AccentColor, transparent 75%);
2023-10-28 00:38:01 +09:00
}
2023-10-28 00:38:01 +09:00
/* Avoids https://github.com/mozilla/pdf.js/issues/13840 in Chrome */
/*#if !MOZCENTRAL*/
2023-10-28 00:38:01 +09:00
br::selection {
background: transparent;
}
/*#endif*/
2023-10-28 00:38:01 +09:00
.endOfContent {
display: block;
position: absolute;
inset: 100% 0 0;
z-index: -1;
cursor: default;
user-select: none;
2023-10-28 00:38:01 +09:00
&.active {
top: 0;
}
}
}