browser.css (10171B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 @import url("chrome://browser/skin/browser-shared.css"); 6 @import url("chrome://browser/skin/contextmenu.css"); 7 8 #menubar-items { 9 flex-direction: column; /* for flex hack */ 10 justify-content: normal; /* align the menubar to the top also in customize mode */ 11 } 12 13 #main-menubar > menu { 14 appearance: none; 15 color: inherit; 16 17 &[_moz-menuactive] { 18 /* stylelint-disable-next-line stylelint-plugin-mozilla/use-design-tokens, stylelint-plugin-mozilla/no-base-design-tokens */ 19 background-color: light-dark(var(--color-black-alpha-10), var(--color-white-alpha-20)); 20 color: inherit; 21 22 @media (prefers-contrast) { 23 background-color: -moz-menuhover; 24 color: -moz-menuhovertext; 25 } 26 } 27 } 28 29 :root[customtitlebar]:not([lwtheme], [builtintheme]) { 30 /* stylelint-disable-next-line media-query-no-invalid */ 31 @media (-moz-windows-mica) or ((-moz-windows-accent-color-in-titlebar) and -moz-pref("browser.theme.windows.accent-color-in-tabs.enabled")) { 32 --toolbox-bgcolor: ActiveCaption; 33 --toolbox-textcolor: CaptionText; 34 --toolbox-bgcolor-inactive: InactiveCaption; 35 --toolbox-textcolor-inactive: InactiveCaptionText; 36 } 37 38 @media (-moz-windows-mica) { 39 background-color: transparent; 40 /* stylelint-disable-next-line media-query-no-invalid */ 41 @media -moz-pref("widget.windows.mica.toplevel-backdrop", 2) { 42 /* For acrylic, do the same we do for popups to guarantee some contrast */ 43 /* stylelint-disable-next-line stylelint-plugin-mozilla/use-design-tokens, stylelint-plugin-mozilla/no-base-design-tokens */ 44 background-color: light-dark(var(--color-white-alpha-60), var(--color-black-alpha-60)); 45 } 46 47 /* Using a semitransparent background preserves the tinting from the backdrop. 48 * Note that the toolbar text color from browser-colors.css should be ok, 49 * as the backdrop matches our color scheme. The .6 matches what we do for 50 * acrylic, and the .15 matches the 85% we do for the default toolbar 51 * background on the native theme. */ 52 --toolbar-bgcolor: light-dark(var(--color-white-alpha-60), var(--color-white-alpha-20)); 53 } 54 55 /* stylelint-disable-next-line media-query-no-invalid */ 56 @media (-moz-windows-accent-color-in-titlebar) and ((-moz-windows-mica) or -moz-pref("browser.theme.windows.accent-color-in-tabs.enabled")) { 57 .browser-toolbox-background { 58 /* These colors match the Linux/HCM default button colors. We need to 59 * override these on the toolbox-like elements because the accent color 60 * is arbitrary, so the hardcoded brand colors from browser-colors.css 61 * might not provide sufficient contrast. */ 62 --toolbarbutton-icon-fill: currentColor; 63 --toolbar-field-color: currentColor; 64 --urlbar-box-bgcolor: var(--button-background-color-hover); 65 --urlbar-box-focus-bgcolor: var(--button-background-color); 66 --urlbar-box-hover-bgcolor: var(--button-background-color-hover); 67 --urlbar-box-active-bgcolor: var(--button-background-color-active); 68 } 69 } 70 } 71 72 /* This is needed for Windows 10, see bug 1961257 */ 73 @media (-moz-windows-accent-color-in-titlebar) { 74 :root[customtitlebar][sizemode="normal"] #navigator-toolbox { 75 border-top: 0.5px solid ActiveBorder; 76 &:-moz-window-inactive { 77 border-top-color: InactiveBorder; 78 } 79 } 80 } 81 82 /* Titlebar */ 83 84 .titlebar-buttonbox { 85 appearance: none; 86 /* The button box must appear on top of the navigator-toolbox in order for 87 * click and hover mouse events to work properly for the button in the restored 88 * window state. Otherwise, elements in the navigator-toolbox, like the menubar, 89 * can swallow those events. 90 */ 91 z-index: 1; 92 } 93 94 .titlebar-buttonbox-container { 95 align-items: stretch; 96 } 97 98 /* Window control buttons */ 99 100 .titlebar-button { 101 appearance: none; 102 border: none; 103 margin: 0; 104 padding: 8px 18px; 105 color: inherit; 106 107 /* Segoe Fluent Icons is the preferred font for Windows 11, and 108 * Segoe MDL2 Assets is there for windows 10. Luckily, the relevant glyphs 109 * are the same, so we can just fall back. 110 * See: https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font */ 111 font: 112 round(10px, env(hairline)) / 1 "Segoe Fluent Icons", 113 "Segoe MDL2 Assets"; /* stylelint-disable-line font-family-no-missing-generic-family-keyword */ 114 115 /* Win10's tablet mode is non-windowed -- windows can't be moved or resized 116 freely. In theory "minimize" might still make sense, but for simplicity we 117 just hide everything but "close". 118 119 (This is not called for in Win11's tablet mode, which _is_ windowed.) 120 */ 121 :root[win10-tablet-mode] &:not(.titlebar-close) { 122 display: none; 123 } 124 125 &:focus-visible { 126 outline: var(--focus-outline); 127 outline-offset: var(--focus-outline-inset); 128 } 129 130 > .toolbarbutton-icon { 131 display: none; 132 } 133 134 &::before { 135 display: inline-block; 136 content: inherit; 137 138 &:-moz-locale-dir(rtl) { 139 transform: scaleX(-1); 140 } 141 } 142 143 @media not (prefers-contrast) { 144 &:hover { 145 background-color: var(--toolbarbutton-hover-background); 146 147 &:active { 148 background-color: var(--toolbarbutton-active-background); 149 } 150 } 151 152 &.titlebar-close:hover { 153 color: white; 154 background-color: hsl(355, 86%, 49%); 155 156 &:active { 157 background-color: hsl(355, 82%, 69%); 158 } 159 } 160 } 161 162 @media (prefers-contrast) { 163 background-color: Field; 164 color: ButtonText; /* FIXME: shouldn't it be FieldText? */ 165 166 &:hover { 167 background-color: SelectedItem; 168 color: SelectedItemText; 169 } 170 } 171 } 172 173 .titlebar-min { 174 /* Even though we use appearance: none, -moz-default-appearance is necessary 175 * for Windows 11's "snap layouts" feature, see 176 * DealWithWindowsAppearanceHacks */ 177 -moz-default-appearance: -moz-window-button-minimize; 178 content: "\e921"; /* ChromeMinimize */ 179 @media (prefers-contrast) { 180 content: "\ef2d"; /* ChromeMinimizeContrast */ 181 } 182 } 183 184 .titlebar-max { 185 -moz-default-appearance: -moz-window-button-maximize; 186 content: "\e922"; /* ChromeMaximize */ 187 @media (prefers-contrast) { 188 content: "\ef2e"; /* ChromeMaximizeContrast */ 189 } 190 } 191 192 .titlebar-restore { 193 -moz-default-appearance: -moz-window-button-restore; 194 content: "\e923"; /* ChromeRestore */ 195 @media (prefers-contrast) { 196 content: "\ef2f"; /* ChromeRestoreContrast */ 197 } 198 } 199 200 .titlebar-close { 201 -moz-default-appearance: -moz-window-button-close; 202 content: "\e8bb"; /* ChromeClose */ 203 @media (prefers-contrast) { 204 content: "\ef2c"; /* ChromeCloseContrast */ 205 } 206 } 207 208 /* Bookmark menus */ 209 210 .bookmark-item { 211 &:is(menu, menuitem) { 212 min-width: 0; 213 max-width: 32em; 214 } 215 216 &:not(.subviewbutton) > .menu-icon { 217 margin-block: 0; 218 } 219 220 &:is(toolbarbutton)[dragover="true"][open="true"] { 221 appearance: none; 222 background: SelectedItem !important; 223 color: SelectedItemText !important; 224 fill: SelectedItemText; 225 } 226 } 227 228 /* Address bar */ 229 230 .urlbar, 231 #searchbar { 232 font-size: 1.15em; 233 } 234 235 @media (prefers-contrast) { 236 :root { 237 /* Windows HCM conventions use these colors for chiclets. We can't use them on 238 other platforms because AccentColor can be shown atop SelectedItem, 239 which has zero contrast. */ 240 --urlbar-box-hover-bgcolor: SelectedItem; 241 --urlbar-box-active-bgcolor: SelectedItem; 242 --urlbar-box-hover-text-color: SelectedItemText; 243 } 244 245 :root:not([lwtheme]) { 246 :not([focused]) > .urlbar-background, 247 #searchbar:not(:focus-within), 248 .findbar-textbox:not(:focus) { 249 border-color: ThreeDShadow; 250 } 251 } 252 } 253 254 /* Autocomplete */ 255 256 #PopupAutoComplete > richlistbox > richlistitem[originaltype~="datalist-first"] { 257 border-top: 1px solid ThreeDShadow; 258 } 259 260 /* Tabstrip */ 261 262 #TabsToolbar { 263 min-height: 0; 264 padding: 0; 265 } 266 267 @media (prefers-contrast) { 268 /* For high contrast themes. XXX is this needed anymore? */ 269 #tabbrowser-tabpanels, 270 :root[privatebrowsingmode="temporary"] #tabbrowser-tabpanels { 271 background-color: -moz-default-background-color; 272 } 273 } 274 275 /* All tabs menupopup */ 276 277 .alltabs-item[selected="true"] { 278 font-weight: var(--font-weight-bold); 279 } 280 281 #UITourTooltipButtons { 282 /** 283 * Override the --arrowpanel-padding so the background extends 284 * to the sides and bottom of the panel. 285 */ 286 margin-inline: -10px; 287 margin-bottom: -10px; 288 } 289 290 /* Make menu items larger when opened through touch. */ 291 panel[touchmode], 292 menupopup[touchmode] { 293 --arrowpanel-menuitem-padding-block: 12px; 294 --arrowpanel-menuitem-padding: var(--arrowpanel-menuitem-padding-block) var(--arrowpanel-menuitem-padding-inline); 295 /* The value for the header back icon padding is selected in a way that the 296 * height of the header and its separator will be equal to the panel inner 297 * top padding plus standard menuitem, so that the header's separator will 298 * be located excatly where a normal toolbarseparator would be located after 299 * the first menuitem, in a menu without a header. */ 300 --arrowpanel-header-back-icon-padding: 10px; 301 } 302 303 :root[uidensity="compact"] panel[touchmode] { 304 --arrowpanel-header-back-icon-padding: 12px; 305 } 306 307 menupopup[touchmode] :is(menu, menuitem, menucaption) { 308 /* Use the var set in the rule above to increase menu items height in menupopups when 309 * they are opened through touch. 310 * Panel menu items already have their padding set in panelUI-shared.css with the same var. */ 311 padding-block: var(--arrowpanel-menuitem-padding-block); 312 } 313 314 #contentAreaContextMenu[touchmode] > #context-navigation > menuitem { 315 /* The navigation menuitems are bigger to begin with because of their inner padding, 316 * so calculate the padding-block to match normal menuitems height when in touchmode. 317 * 3.5em is the desired menuitem height (~42px), minus the menuitem actual height devided by 2. */ 318 padding-block: calc((3.5em - 32px) / 2); 319 } 320 321 /* Other menu separators don't extend all the way to the menu edges, but the 322 one below the navigation buttons in the content context menu should. */ 323 #context-sep-navigation { 324 padding-inline: 0; 325 }