From 0ce6f8b48217e2f494398c2a847e0e077b60f06c Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Wed, 2 Oct 2024 18:21:43 +0200 Subject: [PATCH] [GV] Increase the height (48px) of the toolbar in order to fit the a11y recommendations (bug 1838602) and reorganize the toolbar css to use nested styles. --- web/viewer-geckoview.css | 91 +++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 44 deletions(-) diff --git a/web/viewer-geckoview.css b/web/viewer-geckoview.css index 32defbafefd4c..6c83f2abeff3e 100644 --- a/web/viewer-geckoview.css +++ b/web/viewer-geckoview.css @@ -37,6 +37,8 @@ --toolbar-bg-color: #f9f9fb; --toolbar-divider-color: #e0e0e6; --toolbar-fg-color: #15141a; + --toolbar-height: 48px; + --toolbar-border-width: 1px; --toolbarButton-download-icon: url(images/gv-toolbarButton-download.svg); } @@ -110,8 +112,7 @@ body { #viewerContainer { overflow: auto; position: absolute; - inset-block: 41px 0; - inset-inline: 0; + inset: var(--toolbar-height) 0 0; outline: none; } @@ -176,61 +177,63 @@ body { align-items: center; position: absolute; width: 100%; - height: 40px; + height: calc(var(--toolbar-height) + var(--toolbar-border-width)); top: 0; left: 0; - box-sizing: content-box; - border-block-end: solid 1px var(--toolbar-divider-color); + padding: 2px; + box-sizing: border-box; + border-block-end: solid var(--toolbar-border-width) + var(--toolbar-divider-color); background-color: var(--toolbar-bg-color); -} -#floatingToolbar.show { - z-index: 100000; - opacity: 1; -} + &.show { + z-index: 100000; + opacity: 1; + } -#floatingToolbar:not(show) { - z-index: -1; - opacity: 0; -} + &:not(.show) { + z-index: -1; + opacity: 0; + } -.toolbarButton { - display: flex; - align-items: center; - border-style: none; - user-select: none; - box-sizing: border-box; - background-color: transparent; - width: auto; - height: auto; - outline: none; - position: relative; -} + .toolbarButton { + display: flex; + align-items: center; + border-style: none; + user-select: none; + box-sizing: border-box; + background-color: transparent; + width: auto; + height: 100%; + outline: none; + position: relative; -.toolbarButton > span { - color: var(--toolbar-fg-color); - width: auto; - height: auto; - overflow: hidden; + &::before { + width: 24px; + height: 24px; + content: ""; + background-color: var(--toolbar-fg-color); + mask-size: cover; + margin-inline: 12px 8px; + } + + > span { + color: var(--toolbar-fg-color); + width: auto; + height: auto; + overflow: hidden; + } + + &#download::before { + mask-image: var(--toolbarButton-download-icon); + } + } } :is(.toolbarButton .dialogButton)[disabled] { opacity: 0.5; } -.toolbarButton::before { - width: 24px; - height: 24px; - content: ""; - background-color: var(--toolbar-fg-color); - mask-size: cover; - margin-inline: 12px 8px; -} - -#download::before { - mask-image: var(--toolbarButton-download-icon); -} - .dialogButton { width: auto; margin: 3px 4px 2px !important;