Loading browser/components/screenshots/ScreenshotsOverlayChild.sys.mjs +2 −2 Original line number Diff line number Diff line Loading @@ -317,7 +317,7 @@ class AnonymousContentOverlay { <div class="face"></div> </div> <div class="preview-instructions">${instructions.value}</div> <button class="cancel-shot" id="screenshots-cancel-button">${cancel.value}</button> <button class="screenshots-button" id="screenshots-cancel-button">${cancel.value}</button> </div> </div> <div id="${this.hoverBoxId}"></div> Loading Loading @@ -355,7 +355,7 @@ class AnonymousContentOverlay { <div id="buttons" style="display:none;"> <button id="cancel" class="screenshots-button" title="${cancel.value}" aria-label="${cancel.value}"><img/></button> <button id="copy" class="screenshots-button" title="${copy.value}" aria-label="${copy.value}"><img/>${copy.value}</button> <button id="download" class="screenshots-button" title="${download.value}" aria-label="${download.value}"><img/>${download.value}</button> <button id="download" class="screenshots-button primary" title="${download.value}" aria-label="${download.value}"><img/>${download.value}</button> </div> </div> </div> Loading browser/components/screenshots/content/screenshots.css +28 −495 Original line number Diff line number Diff line Loading @@ -4,532 +4,65 @@ html, body { padding: 0; margin: 0; background-color: transparent; height: 100vh; width: 100vw; } .button, .image-view { width: 100%; height: 100%; display: flex; flex-direction: column; } .preview-buttons { display: flex; align-items: center; justify-content: flex-end; width: 100%; border: 0; box-sizing: border-box; margin: 4px 0; margin-inline-start: calc(-2% + 4px); } .preview-button { display: flex; align-items: center; justify-content: center; border: 0; border-radius: 3px; cursor: pointer; font-size: 16px; font-weight: 400; height: 40px; min-width: 40px; outline: none; padding: 0 10px; position: relative; text-align: center; text-decoration: none; transition: background 150ms cubic-bezier(0.07, 0.95, 0, 1), border 150ms cubic-bezier(0.07, 0.95, 0, 1); user-select: none; white-space: nowrap; min-height: 36px; font-size: 15px; min-width: 36px; } button img { .preview-button > img { -moz-context-properties: fill; fill: currentColor; } .button.hidden, .hidden.preview-button { display: none; } .button.small, .small.preview-button { height: 32px; line-height: 32px; padding: 0 8px; } .button.active, .active.preview-button { background-color: #dedede; } @media (forced-colors: active), (prefers-contrast) { .button.active, .active.preview-button { background-color: ButtonFace; } } .button.tiny, .tiny.preview-button { font-size: 14px; height: 26px; border: 1px solid #c7c7c7; } .button.tiny:hover, .tiny.preview-button:hover, .button.tiny:focus, .tiny.preview-button:focus { background: #ededf0; border-color: #989898; } .button.tiny:active, .tiny.preview-button:active { background: #dedede; border-color: #989898; } .button.block-button, .block-button.preview-button { display: flex; align-items: center; justify-content: center; box-sizing: border-box; border: 0; border-inline-end: 1px solid #c7c7c7; box-shadow: none; border-radius: 0; flex-shrink: 0; font-size: 20px; height: 100px; line-height: 100%; overflow: hidden; } @media (max-width: 719px) { .button.block-button, .block-button.preview-button { justify-content: flex-start; font-size: 16px; height: 72px; margin-inline-end: 10px; padding: 0 5px; } } .button.block-button:hover, .block-button.preview-button:hover { background: #ededf0; } .button.block-button:active, .block-button.preview-button:active { background: #dedede; } @media (forced-colors: active), (prefers-contrast) { .button.block-button:hover, .block-button.preview-button:hover { background-color: ButtonText; } .button.block-button:active, .block-button.preview-button:active { background-color: ButtonFace; } } .button.download, .download.preview-button, .button.flag, .flag.preview-button { background-repeat: no-repeat; background-size: 50%; background-position: center; margin-inline-end: 10px; transition: background-color 150ms cubic-bezier(0.07, 0.95, 0, 1); } .button.download, .download.highlight-button-retry, .download.highlight-button-cancel, .download.highlight-button-download, .download.highlight-button-copy { background-image: url("chrome://browser/content/screenshots/download.svg"); } .button.download:hover, .download.preview-button:hover { background-color: #ededf0; } .button.download:active, .download.preview-button:active { background-color: #dedede; } @media (forced-colors: active), (prefers-contrast) { .button.download:hover, .download.preview-button:hover { background-color: ButtonText; color: ButtonFace; } .button.download:active, .download.preview-button:active { background-color: ButtonFace; color: ButtonText; } } .button.primary, .primary.highlight-retry-cancel, .primary.highlight-button-cancel, .highlight-button-download, .primary.highlight-button-copy { background-color: #0a84ff; color: #fff; } .button.primary:hover, .primary.highlight-button-retry:hover, .primary.highlight-button-cancel:hover, .highlight-button-download:hover, .primary.highlight-button-copy:hover, .button.primary:focus, .primary.highlight-button-retry:focus, .primary.highlight-button-cancel:focus, .highlight-button-download:focus, .primary.highlight-button-copy:focus { background-color: #0072e5; } .button.primary:active, .primary.highlight-button-retry:active, .primary.highlight-button-cancel:active, .highlight-button-download:active, .primary.highlight-button-copy:active { background-color: #0065cc; } @media (forced-colors: active), (prefers-contrast) { .button.primary, .primary.highlight-retry-cancel, .primary.highlight-button-cancel, .highlight-button-download, .primary.highlight-button-copy { background-color: ButtonFace; color: ButtonText; } .button.primary:hover, .primary.highlight-button-retry:hover, .primary.highlight-button-cancel:hover, .highlight-button-download:hover, .primary.highlight-button-copy:hover, .button.primary:focus, .primary.highlight-button-retry:focus, .primary.highlight-button-cancel:focus, .highlight-button-download:focus, .primary.highlight-button-copy:focus { background-color: ButtonText; color: ButtonFace; } .button.primary:active, .primary.highlight-button-retry:active, .primary.highlight-button-cancel:active, .highlight-button-download:active, .primary.highlight-button-copy:active { background-color: ButtonFace; color: ButtonText; } } .button.secondary, .highlight-button-retry, .highlight-button-cancel, .secondary.highlight-button-download, .highlight-button-copy { background-color: #f9f9fa; color: #38383d; } .button.secondary:hover, .highlight-button-retry:hover, .highlight-button-cancel:hover, .secondary.highlight-button-download:hover, .highlight-button-copy:hover { background-color: #ededf0; } .button.secondary:active, .highlight-button-retry:active, .highlight-button-cancel:active, .secondary.highlight-button-download:active, .highlight-button-copy:active { background-color: #dedede; } @media (forced-colors: active), (prefers-contrast) { .button.secondary, .highlight-button-retry, .highlight-button-cancel, .secondary.highlight-button-download, .highlight-button-copy { background-color: ButtonFace; color: ButtonText; } .button.secondary:hover, .highlight-button-retry:hover, .highlight-button-cancel:hover, .secondary.highlight-button-download:hover, .highlight-button-copy:hover { background-color: ButtonText; color: ButtonFace; } .button.secondary:active, .highlight-button-retry:active, .highlight-button-cancel:active, .secondary.highlight-button-download:active, .highlight-button-copy:active { background-color: ButtonFace; color: ButtonText; } } .button.transparent, .transparent.preview-button { background-color: transparent; color: #38383d; } .button.transparent:hover, .transparent.preview-button:hover { background-color: #ededf0; } .button.transparent:focus, .transparent.preview-button:focus, .button.transparent:active, .transparent.preview-button:active { background-color: #dedede; } @media (forced-colors: active), (prefers-contrast) { .button.transparent, .transparent.preview-button { background-color: ButtonFace; color: ButtonText; } .button.transparent:hover, .transparent.preview-button:hover { background-color: ButtonText; color: ButtonFace; } .button.transparent:focus, .transparent.preview-button:focus, .button.transparent:active, .transparent.preview-button:active { background-color: ButtonFace; color: ButtonText; } } .button.warning, .warning.preview-button { color: #fff; background: #d92215; } .button.warning:hover, .warning.preview-button:hover, .button.warning:focus, .warning.preview-button:focus { background: #b81d12; } .button.warning:active, .warning.preview-button:active { background: #a11910; } @media (forced-colors: active), (prefers-contrast) { .button.warning, .warning.preview-button { color: ButtonText; background-color: ButtonFace; } .button.warning:hover, .warning.preview-button:hover, .button.warning:focus, .warning.preview-button:focus { background-color: ButtonText; color: ButtonFace; } .button.warning:active, .warning.preview-button:active { background-color: ButtonFace; } } @keyframes bounce { 0% { transform: translateX(-40px); } 100% { transform: translate(190px); } } @keyframes pulse { 0% { opacity: 0.3; transform: scale(1); } 70% { opacity: 0.25; transform: scale(1.04); } 100% { opacity: 0.3; transform: scale(1); } } .highlight { border-radius: 1px; border: 2px dashed rgba(255, 255, 255, 0.8); box-sizing: border-box; cursor: move; position: absolute; z-index: 9999999999; } /* When prefers contrast is fully supported, we should change these quereies to cover both high and low prefers contrast cases */ @media (forced-colors: active) { .highlight { border: 2px dashed white; opacity: 1.0; } } .highlight-button-cancel { margin: 5px; width: 40px; } .highlight-button-download { margin: 5px; width: auto; font-size: 18px; } .highlight-button-download img { height: 16px; width: 16px; } .highlight-button-download:-moz-locale-dir(rtl) { flex-direction: column-reverse; } .highlight-button-download img:-moz-locale-dir(ltr) { padding-inline-end: 8px; } .highlight-button-download img:-moz-locale-dir(rtl) { padding-inline-start: 8px; } .highlight-button-copy { margin: 5px; width: auto; } .highlight-button-copy img { height: 16px; width: 16px; } .highlight-button-copy:-moz-locale-dir(rtl) { flex-direction: column-reverse; } .highlight-button-copy img:-moz-locale-dir(ltr) { padding-inline-end: 8px; } .highlight-button-copy img:-moz-locale-dir(rtl) { padding-inline-start: 8px; } .preview-buttons { display: flex; align-items: center; justify-content: flex-end; padding-inline-end: 4px; inset-inline-end: 0; width: 100%; height: 60px; border-radius: 4px 4px 0 0; background: rgba(249, 249, 250, 0.8); top: 0; border: 1px solid rgba(249, 249, 250, 0.2); border-bottom: 0; box-sizing: border-box; #download > img, #copy > img { margin-inline-end: 5px; } .preview-image { background-color: rgba(249, 249, 250, 0.8); height: 100%; width: 100%; overflow: auto; } .preview-image-area { margin: 10%; margin-top: 2%; } .image-view { width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); display: flex; flex-direction: column; } .left { margin-inline-start: 0; } .right { margin-inline-start: 20px; #preview-image-div { margin: 2%; margin-top: 0; } #placeholder-image { width: 100%; height: 100%; } @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } } @keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } } browser/components/screenshots/content/screenshots.html +5 −5 Original line number Diff line number Diff line Loading @@ -19,23 +19,23 @@ <template id="screenshots-dialog-template"> <div class="image-view"> <div class="preview-buttons"> <button class="highlight-button-retry preview-button" data-l10n-id="screenshots-retry-button-title"> <button id="retry" class="preview-button" data-l10n-id="screenshots-retry-button-title"> <img src="chrome://global/skin/icons/reload.svg"/> </button> <button class="highlight-button-cancel preview-button" data-l10n-id="screenshots-cancel-button-title"> <button id="cancel" class="preview-button" data-l10n-id="screenshots-cancel-button-title"> <img src="chrome://global/skin/icons/close.svg"/> </button> <button class="highlight-button-copy preview-button" data-l10n-id="screenshots-copy-button-title"> <button id="copy" class="preview-button" data-l10n-id="screenshots-copy-button-title"> <img src="chrome://global/skin/icons/edit-copy.svg"/> <span data-l10n-id="screenshots-copy-button"/> </button> <button class="highlight-button-download preview-button" data-l10n-id="screenshots-download-button-title"> <button id="download" class="preview-button primary" data-l10n-id="screenshots-download-button-title"> <img src="chrome://browser/skin/downloads/downloads.svg"/> <span data-l10n-id="screenshots-download-button"/> </button> </div> <div class="preview-image"> <div id="preview-image-div" class="preview-image-area"> <div id="preview-image-div"> </div> </div> </div> Loading browser/components/screenshots/content/screenshots.js +4 −4 Original line number Diff line number Diff line Loading @@ -30,13 +30,13 @@ class ScreenshotsUI extends HTMLElement { let templateContent = template.content; this.appendChild(templateContent.cloneNode(true)); this._retryButton = this.querySelector(".highlight-button-retry"); this._retryButton = this.querySelector("#retry"); this._retryButton.addEventListener("click", this); this._cancelButton = this.querySelector(".highlight-button-cancel"); this._cancelButton = this.querySelector("#cancel"); this._cancelButton.addEventListener("click", this); this._copyButton = this.querySelector(".highlight-button-copy"); this._copyButton = this.querySelector("#copy"); this._copyButton.addEventListener("click", this); this._downloadButton = this.querySelector(".highlight-button-download"); this._downloadButton = this.querySelector("#download"); this._downloadButton.addEventListener("click", this); } Loading browser/components/screenshots/overlay/overlay.css +146 −111 Original line number Diff line number Diff line Loading @@ -2,6 +2,76 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ :-moz-native-anonymous #screenshots-component { --in-content-page-background: #fff; --in-content-button-text-color: rgb(21, 20, 26); --in-content-button-text-color-hover: var(--in-content-text-color); --in-content-button-text-color-active: var(--in-content-button-text-color); --in-content-button-background: rgba(207,207,216,.33); --in-content-button-background-hover: rgba(207,207,216,.66); --in-content-button-background-active: rgb(207,207,216); --in-content-button-border-color: transparent; --in-content-button-border-color-hover: transparent; --in-content-button-border-color-active: transparent; --in-content-primary-button-text-color: rgb(251,251,254); --in-content-primary-button-text-color-hover: var(--in-content-primary-button-text-color); --in-content-primary-button-text-color-active: var(--in-content-primary-button-text-color); --in-content-primary-button-background: #0061e0; --in-content-primary-button-background-hover: #0250bb; --in-content-primary-button-background-active: #053e94; --in-content-primary-button-border-color: transparent; --in-content-primary-button-border-color-hover: transparent; --in-content-primary-button-border-color-active: transparent; --in-content-focus-outline-color: var(--in-content-primary-button-background); } @media (prefers-color-scheme: dark) { :-moz-native-anonymous #screenshots-component { --in-content-page-background: #42414d; --in-content-button-text-color: rgb(251,251,254); --in-content-button-background: rgb(43,42,51); --in-content-button-background-hover: rgb(82,82,94); --in-content-button-background-active: rgb(91,91,102); --in-content-primary-button-text-color: rgb(43,42,51); --in-content-primary-button-background: rgb(0,221,255); --in-content-primary-button-background-hover: rgb(128,235,255); --in-content-primary-button-background-active: rgb(170,242,255); } } @media (forced-colors: active), (prefers-contrast) { :-moz-native-anonymous #screenshots-component { --in-content-page-background: Canvas; --in-content-button-text-color: ButtonText; --in-content-button-text-color-hover: SelectedItemText; --in-content-button-text-color-active: SelectedItem; --in-content-button-background: ButtonFace; --in-content-button-background-hover: SelectedItem; --in-content-button-background-active: SelectedItemText; --in-content-button-border-color: ButtonText; --in-content-button-border-color-hover: SelectedItemText; --in-content-button-border-color-active: SelectedItem; --in-content-primary-button-text-color: ButtonFace; --in-content-primary-button-text-color-hover: SelectedItemText; --in-content-primary-button-text-color-active: SelectedItem; --in-content-primary-button-background: ButtonText; --in-content-primary-button-background-hover: SelectedItem; --in-content-primary-button-background-active: SelectedItemText; --in-content-primary-button-border-color: ButtonFace; --in-content-primary-button-border-color-hover: SelectedItemText; --in-content-primary-button-border-color-active: SelectedItem; --in-content-focus-outline-color: -moz-DialogText; } } :-moz-native-anonymous #screenshots-component { width: 100%; height: 100%; Loading Loading @@ -59,158 +129,123 @@ cursor: grabbing; } :-moz-native-anonymous #screenshots-cancel-button { background-color: transparent; width: fit-content; cursor: pointer; outline: none; appearance: none; border-radius: 3px; border: 1px #9b9b9b solid; color: #fff; font-family: -apple-system, BlinkMacSystemFont, "segoe ui", "helvetica neue", helvetica, ubuntu, roboto, noto, arial, sans-serif; font-size: 16px; margin-top: 40px; padding: 10px 25px; } :-moz-native-anonymous #screenshots-cancel-button:hover { background-color: #fff; color: #000; } :-moz-native-anonymous .screenshots-button:focus-visible, :-moz-native-anonymous #screenshots-cancel-button:focus-visible { outline: 2px solid #00ddff; outline-offset: 2px; } @media (forced-colors: active), (prefers-contrast) { :-moz-native-anonymous #screenshots-cancel-button { border-color: ButtonBorder; } :-moz-native-anonymous #buttons { position: absolute; margin: 10px 0; display: flex; align-items: center; justify-content: center; background-color: var(--in-content-page-background); border-radius: 4px; padding: 4px; } :-moz-native-anonymous .screenshots-button { cursor: pointer; appearance: none; pointer-events: auto; background-color: #f9f9fa; color: #38383d; border: 0; border-radius: 3px; font-size: 16px; font-weight: 400; height: 40px; min-width: 40px; outline: none; padding: 0 10px; position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; text-align: center; text-decoration: none; transition: background 150ms cubic-bezier(0.07, 0.95, 0, 1), border 150ms cubic-bezier(0.07, 0.95, 0, 1); user-select: none; white-space: nowrap; margin: 0 5px; box-shadow: 0 0 0 1px rgba(12, 12, 13, 0.1), 0 2px 8px rgba(12, 12, 13, 0.1); min-height: 36px; font-size: 15px; min-width: 36px; z-index: 6; } :-moz-native-anonymous .screenshots-button:hover, :-moz-native-anonymous #download:hover { background-color: #52525e; color: #fff; } margin-inline: 4px; font-family: "Segoe UI"; :-moz-native-anonymous .screenshots-button:hover > img { fill: #fff; /* Below styles are copied from common-shared.css */ appearance: none; padding: 7px 15px; text-decoration: none; font-weight: 600; margin: 4px; border: 1px solid var(--in-content-button-border-color); color: var(--in-content-button-text-color); border-radius: 4px; background-color: var(--in-content-button-background); } @media (forced-colors: active), (prefers-contrast) { :-moz-native-anonymous .screenshots-button { background-color: ButtonFace; color: ButtonText; :-moz-native-anonymous .screenshots-button:focus-visible, :-moz-native-anonymous #screenshots-cancel-button:focus-visible { outline: 2px solid var(--in-content-focus-outline-color); outline-offset: 2px; } :-moz-native-anonymous .screenshots-button:hover { background-color: ButtonText; color: ButtonFace; background-color: var(--in-content-button-background-hover); border-color: var(--in-content-button-border-color-hover); color: var(--in-content-button-text-color-hover); } :-moz-native-anonymous .screenshots-button:active { background-color: var(--in-content-button-background-active); border-color: var(--in-content-button-border-color-active); color: var(--in-content-button-text-color-active); } :-moz-native-anonymous button img { -moz-context-properties: fill; fill: currentColor; :-moz-native-anonymous .primary { background-color: var(--in-content-primary-button-background); border-color: var(--in-content-primary-button-border-color); color: var(--in-content-primary-button-text-color); } :-moz-native-anonymous #buttons { position: absolute; margin: 10px 8px; display: flex; align-items: center; justify-content: center; :-moz-native-anonymous .primary:hover { background-color: var(--in-content-primary-button-background-hover); border-color: var(--in-content-primary-button-border-color-hover); color: var(--in-content-primary-button-text-color-hover); } :-moz-native-anonymous #cancel { width: 40px; :-moz-native-anonymous .primary:active { background-color: var(--in-content-primary-button-background-active); border-color: var(--in-content-primary-button-border-color-active); color: var(--in-content-primary-button-text-color-active); } :-moz-native-anonymous #cancel > img { color: #38383d; content: url("chrome://global/skin/icons/close.svg"); width: 20px; height: 20px; padding: 10px 0; :-moz-native-anonymous #screenshots-cancel-button { background-color: transparent; margin-top: 40px; width: fit-content; border-color: #fff; color: #fff; } @media (forced-colors: active), (prefers-contrast) { :-moz-native-anonymous #cancel > img { color: ButtonText; :-moz-native-anonymous #screenshots-cancel-button:hover { background-color: #fff; color: #000; } :-moz-native-anonymous #cancel:hover > img { color: ButtonFace; @media (forced-colors: active), (prefers-contrast) { :-moz-native-anonymous #screenshots-cancel-button { border-color: ButtonBorder; color: CanvasText; } } :-moz-native-anonymous #copy > img { color: #38383d; content: url("chrome://global/skin/icons/edit-copy.svg"); :-moz-native-anonymous .screenshots-button > img { -moz-context-properties: fill; fill: currentColor; width: 16px; height: 16px; } @media (forced-colors: active), (prefers-contrast) { :-moz-native-anonymous #copy > img { color: ButtonText; } :-moz-native-anonymous #copy:hover > img { color: ButtonFace; } :-moz-native-anonymous #cancel > img { content: url("chrome://global/skin/icons/close.svg"); } :-moz-native-anonymous #download { background-color: #0a84ff; color: #fff; :-moz-native-anonymous #copy > img { content: url("chrome://global/skin/icons/edit-copy.svg"); } :-moz-native-anonymous #download > img { content: url("chrome://browser/skin/downloads/downloads.svg"); width: 16px; height: 16px; } @media (forced-colors: active), (prefers-contrast) { :-moz-native-anonymous #download { background-color: ButtonFace; color: ButtonText; } :-moz-native-anonymous #download:hover { background-color: ButtonText; color: ButtonFace; } :-moz-native-anonymous #download > img, :-moz-native-anonymous #copy > img { margin-inline-end: 5px; } :-moz-native-anonymous .fixed-container { Loading Loading
browser/components/screenshots/ScreenshotsOverlayChild.sys.mjs +2 −2 Original line number Diff line number Diff line Loading @@ -317,7 +317,7 @@ class AnonymousContentOverlay { <div class="face"></div> </div> <div class="preview-instructions">${instructions.value}</div> <button class="cancel-shot" id="screenshots-cancel-button">${cancel.value}</button> <button class="screenshots-button" id="screenshots-cancel-button">${cancel.value}</button> </div> </div> <div id="${this.hoverBoxId}"></div> Loading Loading @@ -355,7 +355,7 @@ class AnonymousContentOverlay { <div id="buttons" style="display:none;"> <button id="cancel" class="screenshots-button" title="${cancel.value}" aria-label="${cancel.value}"><img/></button> <button id="copy" class="screenshots-button" title="${copy.value}" aria-label="${copy.value}"><img/>${copy.value}</button> <button id="download" class="screenshots-button" title="${download.value}" aria-label="${download.value}"><img/>${download.value}</button> <button id="download" class="screenshots-button primary" title="${download.value}" aria-label="${download.value}"><img/>${download.value}</button> </div> </div> </div> Loading
browser/components/screenshots/content/screenshots.css +28 −495 Original line number Diff line number Diff line Loading @@ -4,532 +4,65 @@ html, body { padding: 0; margin: 0; background-color: transparent; height: 100vh; width: 100vw; } .button, .image-view { width: 100%; height: 100%; display: flex; flex-direction: column; } .preview-buttons { display: flex; align-items: center; justify-content: flex-end; width: 100%; border: 0; box-sizing: border-box; margin: 4px 0; margin-inline-start: calc(-2% + 4px); } .preview-button { display: flex; align-items: center; justify-content: center; border: 0; border-radius: 3px; cursor: pointer; font-size: 16px; font-weight: 400; height: 40px; min-width: 40px; outline: none; padding: 0 10px; position: relative; text-align: center; text-decoration: none; transition: background 150ms cubic-bezier(0.07, 0.95, 0, 1), border 150ms cubic-bezier(0.07, 0.95, 0, 1); user-select: none; white-space: nowrap; min-height: 36px; font-size: 15px; min-width: 36px; } button img { .preview-button > img { -moz-context-properties: fill; fill: currentColor; } .button.hidden, .hidden.preview-button { display: none; } .button.small, .small.preview-button { height: 32px; line-height: 32px; padding: 0 8px; } .button.active, .active.preview-button { background-color: #dedede; } @media (forced-colors: active), (prefers-contrast) { .button.active, .active.preview-button { background-color: ButtonFace; } } .button.tiny, .tiny.preview-button { font-size: 14px; height: 26px; border: 1px solid #c7c7c7; } .button.tiny:hover, .tiny.preview-button:hover, .button.tiny:focus, .tiny.preview-button:focus { background: #ededf0; border-color: #989898; } .button.tiny:active, .tiny.preview-button:active { background: #dedede; border-color: #989898; } .button.block-button, .block-button.preview-button { display: flex; align-items: center; justify-content: center; box-sizing: border-box; border: 0; border-inline-end: 1px solid #c7c7c7; box-shadow: none; border-radius: 0; flex-shrink: 0; font-size: 20px; height: 100px; line-height: 100%; overflow: hidden; } @media (max-width: 719px) { .button.block-button, .block-button.preview-button { justify-content: flex-start; font-size: 16px; height: 72px; margin-inline-end: 10px; padding: 0 5px; } } .button.block-button:hover, .block-button.preview-button:hover { background: #ededf0; } .button.block-button:active, .block-button.preview-button:active { background: #dedede; } @media (forced-colors: active), (prefers-contrast) { .button.block-button:hover, .block-button.preview-button:hover { background-color: ButtonText; } .button.block-button:active, .block-button.preview-button:active { background-color: ButtonFace; } } .button.download, .download.preview-button, .button.flag, .flag.preview-button { background-repeat: no-repeat; background-size: 50%; background-position: center; margin-inline-end: 10px; transition: background-color 150ms cubic-bezier(0.07, 0.95, 0, 1); } .button.download, .download.highlight-button-retry, .download.highlight-button-cancel, .download.highlight-button-download, .download.highlight-button-copy { background-image: url("chrome://browser/content/screenshots/download.svg"); } .button.download:hover, .download.preview-button:hover { background-color: #ededf0; } .button.download:active, .download.preview-button:active { background-color: #dedede; } @media (forced-colors: active), (prefers-contrast) { .button.download:hover, .download.preview-button:hover { background-color: ButtonText; color: ButtonFace; } .button.download:active, .download.preview-button:active { background-color: ButtonFace; color: ButtonText; } } .button.primary, .primary.highlight-retry-cancel, .primary.highlight-button-cancel, .highlight-button-download, .primary.highlight-button-copy { background-color: #0a84ff; color: #fff; } .button.primary:hover, .primary.highlight-button-retry:hover, .primary.highlight-button-cancel:hover, .highlight-button-download:hover, .primary.highlight-button-copy:hover, .button.primary:focus, .primary.highlight-button-retry:focus, .primary.highlight-button-cancel:focus, .highlight-button-download:focus, .primary.highlight-button-copy:focus { background-color: #0072e5; } .button.primary:active, .primary.highlight-button-retry:active, .primary.highlight-button-cancel:active, .highlight-button-download:active, .primary.highlight-button-copy:active { background-color: #0065cc; } @media (forced-colors: active), (prefers-contrast) { .button.primary, .primary.highlight-retry-cancel, .primary.highlight-button-cancel, .highlight-button-download, .primary.highlight-button-copy { background-color: ButtonFace; color: ButtonText; } .button.primary:hover, .primary.highlight-button-retry:hover, .primary.highlight-button-cancel:hover, .highlight-button-download:hover, .primary.highlight-button-copy:hover, .button.primary:focus, .primary.highlight-button-retry:focus, .primary.highlight-button-cancel:focus, .highlight-button-download:focus, .primary.highlight-button-copy:focus { background-color: ButtonText; color: ButtonFace; } .button.primary:active, .primary.highlight-button-retry:active, .primary.highlight-button-cancel:active, .highlight-button-download:active, .primary.highlight-button-copy:active { background-color: ButtonFace; color: ButtonText; } } .button.secondary, .highlight-button-retry, .highlight-button-cancel, .secondary.highlight-button-download, .highlight-button-copy { background-color: #f9f9fa; color: #38383d; } .button.secondary:hover, .highlight-button-retry:hover, .highlight-button-cancel:hover, .secondary.highlight-button-download:hover, .highlight-button-copy:hover { background-color: #ededf0; } .button.secondary:active, .highlight-button-retry:active, .highlight-button-cancel:active, .secondary.highlight-button-download:active, .highlight-button-copy:active { background-color: #dedede; } @media (forced-colors: active), (prefers-contrast) { .button.secondary, .highlight-button-retry, .highlight-button-cancel, .secondary.highlight-button-download, .highlight-button-copy { background-color: ButtonFace; color: ButtonText; } .button.secondary:hover, .highlight-button-retry:hover, .highlight-button-cancel:hover, .secondary.highlight-button-download:hover, .highlight-button-copy:hover { background-color: ButtonText; color: ButtonFace; } .button.secondary:active, .highlight-button-retry:active, .highlight-button-cancel:active, .secondary.highlight-button-download:active, .highlight-button-copy:active { background-color: ButtonFace; color: ButtonText; } } .button.transparent, .transparent.preview-button { background-color: transparent; color: #38383d; } .button.transparent:hover, .transparent.preview-button:hover { background-color: #ededf0; } .button.transparent:focus, .transparent.preview-button:focus, .button.transparent:active, .transparent.preview-button:active { background-color: #dedede; } @media (forced-colors: active), (prefers-contrast) { .button.transparent, .transparent.preview-button { background-color: ButtonFace; color: ButtonText; } .button.transparent:hover, .transparent.preview-button:hover { background-color: ButtonText; color: ButtonFace; } .button.transparent:focus, .transparent.preview-button:focus, .button.transparent:active, .transparent.preview-button:active { background-color: ButtonFace; color: ButtonText; } } .button.warning, .warning.preview-button { color: #fff; background: #d92215; } .button.warning:hover, .warning.preview-button:hover, .button.warning:focus, .warning.preview-button:focus { background: #b81d12; } .button.warning:active, .warning.preview-button:active { background: #a11910; } @media (forced-colors: active), (prefers-contrast) { .button.warning, .warning.preview-button { color: ButtonText; background-color: ButtonFace; } .button.warning:hover, .warning.preview-button:hover, .button.warning:focus, .warning.preview-button:focus { background-color: ButtonText; color: ButtonFace; } .button.warning:active, .warning.preview-button:active { background-color: ButtonFace; } } @keyframes bounce { 0% { transform: translateX(-40px); } 100% { transform: translate(190px); } } @keyframes pulse { 0% { opacity: 0.3; transform: scale(1); } 70% { opacity: 0.25; transform: scale(1.04); } 100% { opacity: 0.3; transform: scale(1); } } .highlight { border-radius: 1px; border: 2px dashed rgba(255, 255, 255, 0.8); box-sizing: border-box; cursor: move; position: absolute; z-index: 9999999999; } /* When prefers contrast is fully supported, we should change these quereies to cover both high and low prefers contrast cases */ @media (forced-colors: active) { .highlight { border: 2px dashed white; opacity: 1.0; } } .highlight-button-cancel { margin: 5px; width: 40px; } .highlight-button-download { margin: 5px; width: auto; font-size: 18px; } .highlight-button-download img { height: 16px; width: 16px; } .highlight-button-download:-moz-locale-dir(rtl) { flex-direction: column-reverse; } .highlight-button-download img:-moz-locale-dir(ltr) { padding-inline-end: 8px; } .highlight-button-download img:-moz-locale-dir(rtl) { padding-inline-start: 8px; } .highlight-button-copy { margin: 5px; width: auto; } .highlight-button-copy img { height: 16px; width: 16px; } .highlight-button-copy:-moz-locale-dir(rtl) { flex-direction: column-reverse; } .highlight-button-copy img:-moz-locale-dir(ltr) { padding-inline-end: 8px; } .highlight-button-copy img:-moz-locale-dir(rtl) { padding-inline-start: 8px; } .preview-buttons { display: flex; align-items: center; justify-content: flex-end; padding-inline-end: 4px; inset-inline-end: 0; width: 100%; height: 60px; border-radius: 4px 4px 0 0; background: rgba(249, 249, 250, 0.8); top: 0; border: 1px solid rgba(249, 249, 250, 0.2); border-bottom: 0; box-sizing: border-box; #download > img, #copy > img { margin-inline-end: 5px; } .preview-image { background-color: rgba(249, 249, 250, 0.8); height: 100%; width: 100%; overflow: auto; } .preview-image-area { margin: 10%; margin-top: 2%; } .image-view { width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); display: flex; flex-direction: column; } .left { margin-inline-start: 0; } .right { margin-inline-start: 20px; #preview-image-div { margin: 2%; margin-top: 0; } #placeholder-image { width: 100%; height: 100%; } @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } } @keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } }
browser/components/screenshots/content/screenshots.html +5 −5 Original line number Diff line number Diff line Loading @@ -19,23 +19,23 @@ <template id="screenshots-dialog-template"> <div class="image-view"> <div class="preview-buttons"> <button class="highlight-button-retry preview-button" data-l10n-id="screenshots-retry-button-title"> <button id="retry" class="preview-button" data-l10n-id="screenshots-retry-button-title"> <img src="chrome://global/skin/icons/reload.svg"/> </button> <button class="highlight-button-cancel preview-button" data-l10n-id="screenshots-cancel-button-title"> <button id="cancel" class="preview-button" data-l10n-id="screenshots-cancel-button-title"> <img src="chrome://global/skin/icons/close.svg"/> </button> <button class="highlight-button-copy preview-button" data-l10n-id="screenshots-copy-button-title"> <button id="copy" class="preview-button" data-l10n-id="screenshots-copy-button-title"> <img src="chrome://global/skin/icons/edit-copy.svg"/> <span data-l10n-id="screenshots-copy-button"/> </button> <button class="highlight-button-download preview-button" data-l10n-id="screenshots-download-button-title"> <button id="download" class="preview-button primary" data-l10n-id="screenshots-download-button-title"> <img src="chrome://browser/skin/downloads/downloads.svg"/> <span data-l10n-id="screenshots-download-button"/> </button> </div> <div class="preview-image"> <div id="preview-image-div" class="preview-image-area"> <div id="preview-image-div"> </div> </div> </div> Loading
browser/components/screenshots/content/screenshots.js +4 −4 Original line number Diff line number Diff line Loading @@ -30,13 +30,13 @@ class ScreenshotsUI extends HTMLElement { let templateContent = template.content; this.appendChild(templateContent.cloneNode(true)); this._retryButton = this.querySelector(".highlight-button-retry"); this._retryButton = this.querySelector("#retry"); this._retryButton.addEventListener("click", this); this._cancelButton = this.querySelector(".highlight-button-cancel"); this._cancelButton = this.querySelector("#cancel"); this._cancelButton.addEventListener("click", this); this._copyButton = this.querySelector(".highlight-button-copy"); this._copyButton = this.querySelector("#copy"); this._copyButton.addEventListener("click", this); this._downloadButton = this.querySelector(".highlight-button-download"); this._downloadButton = this.querySelector("#download"); this._downloadButton.addEventListener("click", this); } Loading
browser/components/screenshots/overlay/overlay.css +146 −111 Original line number Diff line number Diff line Loading @@ -2,6 +2,76 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ :-moz-native-anonymous #screenshots-component { --in-content-page-background: #fff; --in-content-button-text-color: rgb(21, 20, 26); --in-content-button-text-color-hover: var(--in-content-text-color); --in-content-button-text-color-active: var(--in-content-button-text-color); --in-content-button-background: rgba(207,207,216,.33); --in-content-button-background-hover: rgba(207,207,216,.66); --in-content-button-background-active: rgb(207,207,216); --in-content-button-border-color: transparent; --in-content-button-border-color-hover: transparent; --in-content-button-border-color-active: transparent; --in-content-primary-button-text-color: rgb(251,251,254); --in-content-primary-button-text-color-hover: var(--in-content-primary-button-text-color); --in-content-primary-button-text-color-active: var(--in-content-primary-button-text-color); --in-content-primary-button-background: #0061e0; --in-content-primary-button-background-hover: #0250bb; --in-content-primary-button-background-active: #053e94; --in-content-primary-button-border-color: transparent; --in-content-primary-button-border-color-hover: transparent; --in-content-primary-button-border-color-active: transparent; --in-content-focus-outline-color: var(--in-content-primary-button-background); } @media (prefers-color-scheme: dark) { :-moz-native-anonymous #screenshots-component { --in-content-page-background: #42414d; --in-content-button-text-color: rgb(251,251,254); --in-content-button-background: rgb(43,42,51); --in-content-button-background-hover: rgb(82,82,94); --in-content-button-background-active: rgb(91,91,102); --in-content-primary-button-text-color: rgb(43,42,51); --in-content-primary-button-background: rgb(0,221,255); --in-content-primary-button-background-hover: rgb(128,235,255); --in-content-primary-button-background-active: rgb(170,242,255); } } @media (forced-colors: active), (prefers-contrast) { :-moz-native-anonymous #screenshots-component { --in-content-page-background: Canvas; --in-content-button-text-color: ButtonText; --in-content-button-text-color-hover: SelectedItemText; --in-content-button-text-color-active: SelectedItem; --in-content-button-background: ButtonFace; --in-content-button-background-hover: SelectedItem; --in-content-button-background-active: SelectedItemText; --in-content-button-border-color: ButtonText; --in-content-button-border-color-hover: SelectedItemText; --in-content-button-border-color-active: SelectedItem; --in-content-primary-button-text-color: ButtonFace; --in-content-primary-button-text-color-hover: SelectedItemText; --in-content-primary-button-text-color-active: SelectedItem; --in-content-primary-button-background: ButtonText; --in-content-primary-button-background-hover: SelectedItem; --in-content-primary-button-background-active: SelectedItemText; --in-content-primary-button-border-color: ButtonFace; --in-content-primary-button-border-color-hover: SelectedItemText; --in-content-primary-button-border-color-active: SelectedItem; --in-content-focus-outline-color: -moz-DialogText; } } :-moz-native-anonymous #screenshots-component { width: 100%; height: 100%; Loading Loading @@ -59,158 +129,123 @@ cursor: grabbing; } :-moz-native-anonymous #screenshots-cancel-button { background-color: transparent; width: fit-content; cursor: pointer; outline: none; appearance: none; border-radius: 3px; border: 1px #9b9b9b solid; color: #fff; font-family: -apple-system, BlinkMacSystemFont, "segoe ui", "helvetica neue", helvetica, ubuntu, roboto, noto, arial, sans-serif; font-size: 16px; margin-top: 40px; padding: 10px 25px; } :-moz-native-anonymous #screenshots-cancel-button:hover { background-color: #fff; color: #000; } :-moz-native-anonymous .screenshots-button:focus-visible, :-moz-native-anonymous #screenshots-cancel-button:focus-visible { outline: 2px solid #00ddff; outline-offset: 2px; } @media (forced-colors: active), (prefers-contrast) { :-moz-native-anonymous #screenshots-cancel-button { border-color: ButtonBorder; } :-moz-native-anonymous #buttons { position: absolute; margin: 10px 0; display: flex; align-items: center; justify-content: center; background-color: var(--in-content-page-background); border-radius: 4px; padding: 4px; } :-moz-native-anonymous .screenshots-button { cursor: pointer; appearance: none; pointer-events: auto; background-color: #f9f9fa; color: #38383d; border: 0; border-radius: 3px; font-size: 16px; font-weight: 400; height: 40px; min-width: 40px; outline: none; padding: 0 10px; position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; text-align: center; text-decoration: none; transition: background 150ms cubic-bezier(0.07, 0.95, 0, 1), border 150ms cubic-bezier(0.07, 0.95, 0, 1); user-select: none; white-space: nowrap; margin: 0 5px; box-shadow: 0 0 0 1px rgba(12, 12, 13, 0.1), 0 2px 8px rgba(12, 12, 13, 0.1); min-height: 36px; font-size: 15px; min-width: 36px; z-index: 6; } :-moz-native-anonymous .screenshots-button:hover, :-moz-native-anonymous #download:hover { background-color: #52525e; color: #fff; } margin-inline: 4px; font-family: "Segoe UI"; :-moz-native-anonymous .screenshots-button:hover > img { fill: #fff; /* Below styles are copied from common-shared.css */ appearance: none; padding: 7px 15px; text-decoration: none; font-weight: 600; margin: 4px; border: 1px solid var(--in-content-button-border-color); color: var(--in-content-button-text-color); border-radius: 4px; background-color: var(--in-content-button-background); } @media (forced-colors: active), (prefers-contrast) { :-moz-native-anonymous .screenshots-button { background-color: ButtonFace; color: ButtonText; :-moz-native-anonymous .screenshots-button:focus-visible, :-moz-native-anonymous #screenshots-cancel-button:focus-visible { outline: 2px solid var(--in-content-focus-outline-color); outline-offset: 2px; } :-moz-native-anonymous .screenshots-button:hover { background-color: ButtonText; color: ButtonFace; background-color: var(--in-content-button-background-hover); border-color: var(--in-content-button-border-color-hover); color: var(--in-content-button-text-color-hover); } :-moz-native-anonymous .screenshots-button:active { background-color: var(--in-content-button-background-active); border-color: var(--in-content-button-border-color-active); color: var(--in-content-button-text-color-active); } :-moz-native-anonymous button img { -moz-context-properties: fill; fill: currentColor; :-moz-native-anonymous .primary { background-color: var(--in-content-primary-button-background); border-color: var(--in-content-primary-button-border-color); color: var(--in-content-primary-button-text-color); } :-moz-native-anonymous #buttons { position: absolute; margin: 10px 8px; display: flex; align-items: center; justify-content: center; :-moz-native-anonymous .primary:hover { background-color: var(--in-content-primary-button-background-hover); border-color: var(--in-content-primary-button-border-color-hover); color: var(--in-content-primary-button-text-color-hover); } :-moz-native-anonymous #cancel { width: 40px; :-moz-native-anonymous .primary:active { background-color: var(--in-content-primary-button-background-active); border-color: var(--in-content-primary-button-border-color-active); color: var(--in-content-primary-button-text-color-active); } :-moz-native-anonymous #cancel > img { color: #38383d; content: url("chrome://global/skin/icons/close.svg"); width: 20px; height: 20px; padding: 10px 0; :-moz-native-anonymous #screenshots-cancel-button { background-color: transparent; margin-top: 40px; width: fit-content; border-color: #fff; color: #fff; } @media (forced-colors: active), (prefers-contrast) { :-moz-native-anonymous #cancel > img { color: ButtonText; :-moz-native-anonymous #screenshots-cancel-button:hover { background-color: #fff; color: #000; } :-moz-native-anonymous #cancel:hover > img { color: ButtonFace; @media (forced-colors: active), (prefers-contrast) { :-moz-native-anonymous #screenshots-cancel-button { border-color: ButtonBorder; color: CanvasText; } } :-moz-native-anonymous #copy > img { color: #38383d; content: url("chrome://global/skin/icons/edit-copy.svg"); :-moz-native-anonymous .screenshots-button > img { -moz-context-properties: fill; fill: currentColor; width: 16px; height: 16px; } @media (forced-colors: active), (prefers-contrast) { :-moz-native-anonymous #copy > img { color: ButtonText; } :-moz-native-anonymous #copy:hover > img { color: ButtonFace; } :-moz-native-anonymous #cancel > img { content: url("chrome://global/skin/icons/close.svg"); } :-moz-native-anonymous #download { background-color: #0a84ff; color: #fff; :-moz-native-anonymous #copy > img { content: url("chrome://global/skin/icons/edit-copy.svg"); } :-moz-native-anonymous #download > img { content: url("chrome://browser/skin/downloads/downloads.svg"); width: 16px; height: 16px; } @media (forced-colors: active), (prefers-contrast) { :-moz-native-anonymous #download { background-color: ButtonFace; color: ButtonText; } :-moz-native-anonymous #download:hover { background-color: ButtonText; color: ButtonFace; } :-moz-native-anonymous #download > img, :-moz-native-anonymous #copy > img { margin-inline-end: 5px; } :-moz-native-anonymous .fixed-container { Loading