mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
[Editor] Add a tooltip showing the alt text when hovering the alt-text button (bug 1844952)
This commit is contained in:
parent
8d326e5e30
commit
7952a36384
4 changed files with 95 additions and 40 deletions
|
@ -529,13 +529,53 @@
|
|||
mask-image: var(--alt-text-done-image);
|
||||
}
|
||||
|
||||
& .description {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
& .tooltip {
|
||||
display: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
|
||||
&.decorative {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
&.show {
|
||||
--alt-text-tooltip-bg: #f0f0f4;
|
||||
--alt-text-tooltip-fg: #15141a;
|
||||
--alt-text-tooltip-border: #8f8f9d;
|
||||
--alt-text-tooltip-shadow: 0px 2px 6px 0px rgba(58, 57, 68, 0.2);
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
--alt-text-tooltip-bg: #1c1b22;
|
||||
--alt-text-tooltip-fg: #fbfbfe;
|
||||
--alt-text-tooltip-shadow: 0px 2px 6px 0px #15141a;
|
||||
}
|
||||
|
||||
@media screen and (forced-colors: active) {
|
||||
--alt-text-tooltip-bg: Canvas;
|
||||
--alt-text-tooltip-fg: CanvasText;
|
||||
--alt-text-tooltip-border: CanvasText;
|
||||
--alt-text-tooltip-shadow: none;
|
||||
}
|
||||
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
top: calc(100% + 2px);
|
||||
inset-inline-start: 0;
|
||||
padding-block: 2px 3px;
|
||||
padding-inline: 3px;
|
||||
max-width: 300px;
|
||||
width: max-content;
|
||||
height: auto;
|
||||
font-size: 12px;
|
||||
|
||||
border: 0.5px solid var(--alt-text-tooltip-border);
|
||||
background: var(--alt-text-tooltip-bg);
|
||||
box-shadow: var(--alt-text-tooltip-shadow);
|
||||
color: var(--alt-text-tooltip-fg);
|
||||
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,8 @@ const DEFAULT_L10N_STRINGS = {
|
|||
editor_free_text2_aria_label: "Text Editor",
|
||||
editor_ink2_aria_label: "Draw Editor",
|
||||
editor_ink_canvas_aria_label: "User-created image",
|
||||
alt_text_button_label: "Alt text",
|
||||
editor_alt_text_button_label: "Alt text",
|
||||
editor_alt_text_decorative_tooltip: "Marked as decorative",
|
||||
};
|
||||
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {
|
||||
DEFAULT_L10N_STRINGS.print_progress_percent = "{{progress}}%";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue