summaryrefslogtreecommitdiffstats
path: root/browser/themes/windows/browser.css
blob: 768fd95c38ad6127af4e8f09d8dec042b706ef88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
/* This Source Code Form is subject to the terms of the Mozilla Public
 * 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/. */

@import url("chrome://browser/skin/browser-shared.css");
@import url("chrome://browser/skin/contextmenu.css");
@import url("chrome://browser/skin/browser-custom-colors.css");

@namespace html url("http://www.w3.org/1999/xhtml");

:root {
  --toolbar-non-lwt-bgcolor: color-mix(in srgb, -moz-dialog 85%, white);
  --toolbar-non-lwt-textcolor: -moz-dialogtext;

  --chrome-content-separator-color: ThreeDShadow;
}

@media (-moz-windows-default-theme) {
  :root {
    --toolbar-non-lwt-bgcolor: -moz-dialog;
  }
}

:root:-moz-lwtheme {
  --chrome-content-separator-color: rgba(0,0,0,.3);
}

#menubar-items {
  flex-direction: column; /* for flex hack */
}

#main-menubar > menu {
  appearance: none;
  color: inherit;
}

#main-menubar > menu[_moz-menuactive="true"] {
  background-color: -moz-menuhover;
  color: -moz-menuhovertext;
}

/* Use a different color only on Windows 8 and higher in inactive windows.
 * On Win 7, the menubar fog disappears for inactive windows, and renders gray
 * illegible.
 */
@media (-moz-windows-default-theme) {
  @media not (-moz-platform: windows-win7) {
    #toolbar-menubar:not(:-moz-lwtheme):-moz-window-inactive {
      color: ThreeDShadow;
    }
  }
}

@media not (-moz-platform: windows-win7) {
  @media not (-moz-platform: windows-win8) {
    /* On Windows 10, when temporarily showing the menu bar, make it at least as
     * tall as the tab bar such that the window controls don't appear to move up. */
    :root[tabsintitlebar] #toolbar-menubar[autohide="true"] {
      height: calc(var(--tab-min-height) - var(--tabs-navbar-shadow-size));
    }
    :root[tabsintitlebar][sizemode="normal"] #toolbar-menubar[autohide="true"] {
      height: calc(var(--tab-min-height) - var(--tabs-navbar-shadow-size));
    }
  }
}

/* Add 4px extra margin on top of the tabs toolbar on Windows 7. */
@media (-moz-platform: windows-win7) {
  :root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .toolbar-items,
  :root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .toolbar-items {
    padding-top: 4px;
  }
}

#navigator-toolbox,
.browser-toolbar {
  appearance: none;
}

.browser-toolbar:not(.titlebar-color) {
  background-color: var(--toolbar-bgcolor);
  background-clip: padding-box;
  color: var(--toolbar-color);
}

/* Add a fog for background tabs to be visible on Windows 7 glass window background */
@media (-moz-platform: windows-win7) {
  @media (-moz-windows-default-theme) {
    #TabsToolbar:not(:-moz-lwtheme) {
      background-image: radial-gradient(ellipse at bottom, rgba(255,255,255,0.8), rgba(255,255,255,0.5) 80%, transparent);
    }
  }
}

@media (-moz-windows-compositor: 0),
       (-moz-windows-default-theme: 0),
       (-moz-platform: windows-win8) {
  /* Please keep the menu text colors in this media block in sync with
   * light-dark-overrides.css, minus the :not(:-moz-lwtheme) condition - see Bug 1165718.
   */
  :root[tabsintitlebar]:not(:-moz-lwtheme) {
    color: CaptionText;
  }

  :root[tabsintitlebar]:not(:-moz-lwtheme):-moz-window-inactive {
    color: InactiveCaptionText;
  }
}

@media (-moz-windows-classic) {
  /**
   * In the classic themes, the titlebar has a horizontal gradient, which is
   * problematic for reading the text of background tabs when they're in the
   * titlebar. We side-step this issue by layering our own background underneath
   * the tabs.
   */
  :root[tabsintitlebar]:not([sizemode=fullscreen]) #TabsToolbar:not(:-moz-lwtheme) {
    background-image: linear-gradient(transparent, ActiveCaption);
    background-size: auto 200%;
  }

  :root[tabsintitlebar]:not([sizemode=fullscreen]) #TabsToolbar:not(:-moz-lwtheme):-moz-window-inactive {
    background-image: linear-gradient(transparent, InactiveCaption);
  }

  /* Add a window top border for webextension themes */
  :root[tabsintitlebar][sizemode="normal"] #navigator-toolbox:-moz-lwtheme {
    background-image: linear-gradient(to bottom,
          ThreeDLightShadow 0, ThreeDLightShadow 1px,
          ThreeDHighlight 1px, ThreeDHighlight 2px,
          ActiveBorder 2px, ActiveBorder 4px, transparent 4px);
  }

  :root[tabsintitlebar] :is(#TabsToolbar, #toolbar-menubar) toolbarbutton:not(:-moz-lwtheme) {
    color: inherit;
  }
}

#nav-bar:not([tabs-hidden="true"]) {
  /* This is needed for some toolbar button animations. Gross :( */
  position: relative;
}

@media (-moz-windows-default-theme: 0) {
  #nav-bar:not(:-moz-lwtheme) {
    box-shadow: 0 calc(-1 * var(--tabs-navbar-shadow-size)) 0 ThreeDShadow;
  }
}
#nav-bar:-moz-lwtheme {
  box-shadow: 0 calc(-1 * var(--tabs-navbar-shadow-size)) 0 var(--lwt-tabs-border-color, rgba(0,0,0,.3));
}
@media (-moz-windows-compositor: 0) {
  #nav-bar[tabs-hidden="true"] {
    box-shadow: none;
  }
}

#print-preview-toolbar:not(:-moz-lwtheme) {
  appearance: auto;
  -moz-default-appearance: toolbox;
}

/* Titlebar */

:root[tabsintitlebar][sizemode="normal"] #titlebar {
  appearance: auto;
  -moz-default-appearance: -moz-window-titlebar;
}

:root[tabsintitlebar][sizemode="maximized"] #titlebar {
  appearance: auto;
  -moz-default-appearance: -moz-window-titlebar-maximized;
}

@media (-moz-windows-compositor: 0) {
  /**
   * Anytime we're not using the compositor on Windows, the -moz-window-titlebar
   * and -moz-window-titlebar-maximized values for -moz-appearance override
   * backgrounds supplied by lwthemes. We make the #titlebar itself hidden, but
   * it's children visible in order to hide the background but keep the margin and
   * padding that comes from those -moz-window-titlebar rules.
   */
  :root:not([inFullscreen]) #titlebar:-moz-lwtheme {
    visibility: hidden;
  }
  :root:not([inFullscreen], [chromehidden~="menubar"]) #toolbar-menubar:-moz-lwtheme,
  :root:not([inFullscreen], [chromehidden~="toolbar"]) #TabsToolbar:-moz-lwtheme {
    visibility: visible;
  }
}

@media (-moz-windows-classic) {
  :root[tabsintitlebar][sizemode="normal"] #toolbar-menubar {
    margin-top: 4px;
  }
}

.titlebar-buttonbox {
  /* For all Windows configurations except for Windows Aero and Windows Aero Basic,
   * the default -moz-default-appearance of -moz-window-button-box and
   * -moz-window-button-box-maximized adds unwanted margins to the button box. We
   * special case Windows Aero and Windows Aero Basic in browser-aero.css.
   */
  appearance: none;
  /* The button box must appear on top of the navigator-toolbox in order for
   * click and hover mouse events to work properly for the button in the restored
   * window state. Otherwise, elements in the navigator-toolbox, like the menubar,
   * can swallow those events. It will also place the buttons above the fog on
   * Windows 7 with Aero Glass.
   */
  z-index: 1;
}

.titlebar-buttonbox-container {
  align-items: stretch;
}

@media (-moz-platform: windows-win7),
       (-moz-platform: windows-win8) {
  /* Preserve window control buttons position at the top of the button box. */
  .titlebar-buttonbox-container {
    align-items: flex-start;
  }
}

/* Window control buttons */

.titlebar-min {
  appearance: auto;
  -moz-default-appearance: -moz-window-button-minimize;
}

.titlebar-max {
  appearance: auto;
  -moz-default-appearance: -moz-window-button-maximize;
}

.titlebar-restore {
  appearance: auto;
  -moz-default-appearance: -moz-window-button-restore;
}

.titlebar-close {
  appearance: auto;
  -moz-default-appearance: -moz-window-button-close;
}

@media (-moz-windows-classic: 0) {
  .titlebar-min {
    margin-inline-end: 2px;
  }
}

:root[tabletmode] .titlebar-min,
:root[tabletmode] .titlebar-restore,
:root[tabletmode] .titlebar-max {
  display: none;
}

/* Bookmark menus */

menu.bookmark-item,
menuitem.bookmark-item {
  min-width: 0;
  max-width: 32em;
}

.bookmark-item:not(.subviewbutton) > .menu-iconic-left {
  margin-block: 0;
}

.bookmark-item[cutting] > .toolbarbutton-icon,
.bookmark-item[cutting] > .menu-iconic-left > .menu-iconic-icon {
  opacity: 0.5;
}

.bookmark-item[cutting] > .toolbarbutton-text,
.bookmark-item[cutting] > .menu-iconic-left > .menu-iconic-text {
  opacity: 0.7;
}


/* Address bar */

@media not (prefers-contrast) {
  :root:not(:-moz-lwtheme) #urlbar {
    --urlbar-box-bgcolor: white;
  }
  :root[lwt-default-theme-in-dark-mode] #urlbar {
    --urlbar-box-bgcolor: var(--toolbar-field-focus-background-color);
  }
}

#urlbar,
#searchbar {
  font-size: 1.15em;
}

@supports -moz-bool-pref("browser.urlbar.experimental.expandTextOnFocus") {
  #urlbar[breakout-extend] {
    font-size: 1.25em;
  }
}

@media (-moz-windows-default-theme: 0) {
  /* Windows HCM conventions use these colors for chiclets. We can't use them on
     other platforms because AccentColor can be shown atop SelectedItem,
     which has zero contrast. */
  :root {
    --urlbar-box-hover-bgcolor: SelectedItem;
    --urlbar-box-active-bgcolor: SelectedItem;
    --urlbar-box-hover-text-color: SelectedItemText;
  }

  #urlbar:not(:-moz-lwtheme, [focused="true"]) > #urlbar-background,
  #searchbar:not(:-moz-lwtheme, :focus-within),
  .findbar-textbox:not(:-moz-lwtheme, :focus) {
    border-color: ThreeDShadow;
  }
}

/* Address bar results view */

@media (-moz-windows-default-theme: 0) {
  :root:not(:-moz-lwtheme) {
    --urlbar-popup-action-color: -moz-nativehyperlinktext;
  }
}

/* Autocomplete */

#PopupAutoComplete > richlistbox > richlistitem[originaltype~="datalist-first"] {
  border-top: 1px solid ThreeDShadow;
}

/* Content area */

#browser {
  --sidebar-border-color: ThreeDLightShadow;
}

/* Tabstrip */

#TabsToolbar {
  min-height: 0;
  padding: 0;
}

@media (-moz-windows-default-theme: 0) {
  /* For high contrast themes. */
  #tabbrowser-tabpanels,
  :root[privatebrowsingmode=temporary] #tabbrowser-tabpanels {
    background-color: -moz-default-background-color;
  }
}

/* All tabs menupopup */

.alltabs-item[selected="true"] {
  font-weight: bold;
}

toolbarbutton.bookmark-item[dragover="true"][open="true"] {
  appearance: none;
  background: SelectedItem !important;
  color: SelectedItemText !important;
  fill: SelectedItemText;
}

/* Bookmarks roots menu-items */

#bookmarksToolbarFolderMenu,
#BMB_bookmarksToolbar,
#panelMenu_bookmarksToolbar {
  list-style-image: url("chrome://browser/skin/places/bookmarksToolbar.svg");
}

/* Status panel */

#statuspanel-label {
  margin: 0;
  padding: 2px 4px;
  background-color: -moz-dialog;
  border: 1px none ThreeDLightShadow;
  border-top-style: solid;
  color: -moz-dialogText;
  text-shadow: none;
}

@media (-moz-windows-default-theme) {
  #statuspanel-label {
    background-color: #f9f9fa;
    color: #444;
  }
}

@media (-moz-content-prefers-color-scheme: dark) {
  #statuspanel-label {
    background-color: hsl(240, 1%, 20%);
    border-color: hsl(240, 1%, 40%);
    color: rgb(249, 249, 250);
  }
}

#statuspanel:not([mirror]) > #statuspanel-label:-moz-locale-dir(ltr),
#statuspanel[mirror] > #statuspanel-label:-moz-locale-dir(rtl) {
  border-right-style: solid;
  /* disabled for triggering grayscale AA (bug 659213)
  border-top-right-radius: .3em;
  */
  margin-right: 1em;
}

#statuspanel:not([mirror]) > #statuspanel-label:-moz-locale-dir(rtl),
#statuspanel[mirror] > #statuspanel-label:-moz-locale-dir(ltr) {
  border-left-style: solid;
  /* disabled for triggering grayscale AA (bug 659213)
  border-top-left-radius: .3em;
  */
  margin-left: 1em;
}

/* Prevent window controls from overlapping the nav bar's shadow on the tab
 * bar. */
#TabsToolbar > .titlebar-buttonbox-container {
  margin-bottom: var(--tabs-navbar-shadow-size);
}

.private-browsing-indicator {
  margin-inline: 12px;
}

#UITourTooltipButtons {
  /**
   * Override the --arrowpanel-padding so the background extends
   * to the sides and bottom of the panel.
   */
  margin-inline: -10px;
  margin-bottom: -10px;
}

/* Make menu items larger when opened through touch. */
panel[touchmode],
menupopup[touchmode] {
  --arrowpanel-menuitem-padding-block: 12px;
  --arrowpanel-menuitem-padding: var(--arrowpanel-menuitem-padding-block) var(--arrowpanel-menuitem-padding-inline);
  /* The value for the header back icon padding is selected in a way that the
   * height of the header and its separator will be equal to the panel inner
   * top padding plus standard menuitem, so that the header's separator will
   * be located excatly where a normal toolbarseparator would be located after
   * the first menuitem, in a menu without a header. */
  --arrowpanel-header-back-icon-padding: 10px;
}

:root[uidensity="compact"] panel[touchmode] {
  --arrowpanel-header-back-icon-padding: 12px;
}

menupopup[touchmode] :is(menu, menuitem, menucaption) {
  /* Use the var set in the rule above to increase menu items height in menupopups when
   * they are opened through touch.
   * Panel menu items already have their padding set in panelUI-shared.css with the same var. */
  padding-block: var(--arrowpanel-menuitem-padding-block);
}

#contentAreaContextMenu[touchmode] > #context-navigation > menuitem {
  /* The navigation menuitems are bigger to begin with because of their inner padding,
   * so calculate the padding-block to match normal menuitems height when in touchmode.
   * 3.5em is the desired menuitem height (~42px), minus the menuitem actual height devided by 2. */
  padding-block: calc((3.5em - 32px) / 2);
}

#context-navigation {
  background-color: menu;
}

#context-sep-navigation {
  margin-inline-start: -28px;
}

@media (-moz-windows-non-native-menus) {
  /* :not([hidden]) to avoid the display: flex unhiding the item. */
  #context-navigation:not([hidden]) {
    /* The Windows 10 version of the navigation area needs the scrollbox's
       background color, not the builtin "menu" color. */
    background-color: inherit;
    /* Match the inner top padding of the menupopup to center the icons visually. */
    padding-bottom: 4px;
    /* Use modern flex box so we can use percentage widths to redistribute
     * spacing manually. */
    display: flex;
    flex-direction: row;
    /* We want the first and last icons to align with the text items which
     * have 1em inline padding, and for icons to be centered within their
     * hover state, so each icon of 16px needs 1em padding on both sides:
     */
    --menuitem-min-width: calc(2em + 16px);
    /* The total width of the container should then be at least 4 times that: */
    min-width: calc(4 * var(--menuitem-min-width));
  }

  #context-navigation > .menuitem-iconic {
    flex: 1 0 auto;
  }

  #context-navigation > .menuitem-iconic[_moz-menuactive="true"] {
    /* We only show hover state on the icons. This ensures there is no
     * dead space between icons, but the visible hover state is only
     * around the icons, and all the icons' hover states match each other.
     */
    background-color: transparent;
  }

  #context-navigation > .menuitem-iconic > .menu-iconic-left {
    margin: 0;
    padding: 0;
  }

  /* override styles from shared/contextmenu.inc.css */
  #context-navigation > .menuitem-iconic > .menu-iconic-left > .menu-iconic-icon {
    width: var(--menuitem-min-width);
    height: 32px;
    padding: 8px 1em;
    margin: 0;
  }
  #context-navigation > .menuitem-iconic[_moz-menuactive="true"] > .menu-iconic-left > .menu-iconic-icon {
    background-color: -moz-menuhover;
  }

  #context-navigation > .menuitem-iconic[_moz-menuactive="true"][disabled="true"] > .menu-iconic-left > .menu-iconic-icon {
    background-color: -moz-menuhoverdisabled;
  }

  /* If the menu is wider than the icons strictly need, the <menuitem> elements
   * will stretch to pick up the extra space. In that case, the outer icons
   * should align to the start/end of their containing <menuitem>: */
  #context-navigation > .menuitem-iconic:first-child {
    justify-content: flex-start;
  }

  #context-navigation > .menuitem-iconic:last-child {
    justify-content: flex-end;
  }

  #context-navigation > .menuitem-iconic:last-child,
  #context-navigation > .menuitem-iconic:first-child {
    flex-grow: 0;
    /* The first and last items start off as 16px + 2em, like the other ones.
     * 100% is the width of the parent, which will be at least 4 * the width of
     * an individual item (16px + 2em)
     * So 100% - 4 item widths gets us the remaining available space if
     * #context-navigation is wider than that.
     * Then divide by 6 to get the 1/6 of that extra space, and add this space
     * to the width of the first/last items.
     * This ensures that the 3 visual gaps between the 4 icons are all the same
     * size, with each 1/3 of the available space evenly distributed between
     * the 2 items on either side of the gap.
     */
    width: calc(var(--menuitem-min-width) + calc(100% - 4 * var(--menuitem-min-width)) / 6);
  }


  /* Other menu separators don't extend all the way to the menu edges, but the
     one below the navigation buttons in the content context menu should. */
  #context-sep-navigation {
    margin-top: 0;
    margin-inline: 0;
  }
}