summaryrefslogtreecommitdiffstats
path: root/browser/themes/windows/browser.css
blob: c4c2f814c76d456b6e82655c30d085734b0cfae8 (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
/* 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");

#menubar-items {
  flex-direction: column; /* for flex hack */
  justify-content: normal; /* align the menubar to the top also in customize mode */
}

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

  &[_moz-menuactive] {
    background-color: light-dark(hsla(0,0%,0%,.12), hsla(0,0%,100%,.22));
    color: inherit;

    @media (prefers-contrast) {
      background-color: -moz-menuhover;
      color: -moz-menuhovertext;
    }
  }
}

@media (-moz-windows-accent-color-in-titlebar) {
  :root[tabsintitlebar] {
    /* stylelint-disable-next-line media-query-no-invalid */
    @media (-moz-bool-pref: "browser.theme.windows.accent-color-in-tabs.enabled") {
      --toolbox-non-lwt-bgcolor: ActiveCaption;
      --toolbox-non-lwt-textcolor: CaptionText;
      --toolbox-non-lwt-bgcolor-inactive: InactiveCaption;
      --toolbox-non-lwt-textcolor-inactive: InactiveCaptionText;

      #TabsToolbar:not(:-moz-lwtheme) {
        /* These colors match the Linux/HCM default button colors. We need to
         * override these on the tabs toolbar because the accent color is
         * arbitrary, so the hardcoded colors from browser-custom-colors might
         * not provide sufficient contrast. */
        --toolbarbutton-icon-fill: currentColor;
        --toolbarbutton-hover-background: color-mix(in srgb, currentColor 17%, transparent);
        --toolbarbutton-active-background: color-mix(in srgb, currentColor 30%, transparent);
      }
    }

    &[sizemode="normal"] #navigator-toolbox {
      border-top: .5px solid ActiveBorder;
      &:-moz-window-inactive {
        border-top-color: InactiveBorder;
      }
    }
  }
}

/* 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));
}

/* Titlebar */

.titlebar-buttonbox {
  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;

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

/* Window control buttons */

.titlebar-button {
  appearance: none;
  border: none;
  margin: 0;
  padding: 8px 17px;
  -moz-context-properties: stroke;
  stroke: currentColor;

  :root[tabletmode] & {
    display: none;
  }

  &:focus-visible {
    outline: var(--focus-outline);
    outline-offset: var(--focus-outline-inset);
  }

  > .toolbarbutton-icon {
    width: 12px;
    height: 12px;

    &:-moz-locale-dir(rtl) {
      transform: scaleX(-1);
    }
  }
}

.titlebar-min {
  /* Even though we use appearance: none, -moz-default-appearance is necessary
   * for Windows 11's "snap layouts" feature, see
   * DealWithWindowsAppearanceHacks */
  -moz-default-appearance: -moz-window-button-minimize;
  list-style-image: url(chrome://browser/skin/window-controls/minimize.svg);
}

.titlebar-max {
  -moz-default-appearance: -moz-window-button-maximize;
  list-style-image: url(chrome://browser/skin/window-controls/maximize.svg);
}

.titlebar-restore {
  -moz-default-appearance: -moz-window-button-restore;
  list-style-image: url(chrome://browser/skin/window-controls/restore.svg);
}

.titlebar-close {
  -moz-default-appearance: -moz-window-button-close;
  list-style-image: url(chrome://browser/skin/window-controls/close.svg);
}

:root[lwtheme-image] {
  .titlebar-button {
    -moz-context-properties: unset;
  }
  .titlebar-min {
    list-style-image: url(chrome://browser/skin/window-controls/minimize-themes.svg);
  }
  .titlebar-max {
    list-style-image: url(chrome://browser/skin/window-controls/maximize-themes.svg);
  }
  .titlebar-restore {
    list-style-image: url(chrome://browser/skin/window-controls/restore-themes.svg);
  }
  .titlebar-close {
    list-style-image: url(chrome://browser/skin/window-controls/close-themes.svg);
  }
}

@media not (prefers-contrast) {
  .titlebar-button:hover {
    background-color: light-dark(hsla(0,0%,0%,.12), hsla(0,0%,100%,.22));

    &:active {
      background-color: light-dark(hsla(0,0%,0%,.22), hsla(0,0%,100%,.32));
    }
  }

  .titlebar-close:hover {
    stroke: white;
    background-color: hsl(355,86%,49%);

    &:active {
      background-color: hsl(355,82%,69%);
    }
  }
}

@media (prefers-contrast) {
  .titlebar-button {
    background-color: -moz-field;
    stroke: ButtonText;

    &:hover {
      background-color: SelectedItem;
      stroke: SelectedItemText;
    }
  }

  .titlebar-min {
    list-style-image: url(chrome://browser/skin/window-controls/minimize-highcontrast.svg);
  }

  .titlebar-max {
    list-style-image: url(chrome://browser/skin/window-controls/maximize-highcontrast.svg);
  }

  .titlebar-restore {
    list-style-image: url(chrome://browser/skin/window-controls/restore-highcontrast.svg);
  }

  .titlebar-close {
    list-style-image: url(chrome://browser/skin/window-controls/close-highcontrast.svg);
  }
}

/* the 12px image renders a 10px icon, and the 10px upscaled gets rounded to 12.5, which
 * rounds up to 13px, which makes the icon one pixel too big on 1.25dppx. Fix: */
@media (1.20dppx <= resolution <= 1.45dppx) {
  .titlebar-button > .toolbarbutton-icon {
    width: 11.5px;
    height: 11.5px;
  }
}

/* 175% dpi should result in the same device pixel sizes as 150% dpi. */
@media (1.70dppx <= resolution <= 1.95dppx) {
  .titlebar-button {
    padding-inline: 14.1px;

    > .toolbarbutton-icon {
      width: 10.8px;
      height: 10.8px;
    }
  }
}

/* 225% dpi should result in the same device pixel sizes as 200% dpi. */
@media (2.20dppx <= resolution <= 2.45dppx) {
  .titlebar-button {
    padding-inline: 15.3333px;

    > .toolbarbutton-icon {
      width: 10.8px;
      height: 10.8px;
    }
  }
}

/* 275% dpi should result in the same device pixel sizes as 250% dpi. */
@media (2.70dppx <= resolution <= 2.95dppx) {
  /* NB: todo: this should also change padding on the buttons
   * themselves, but without a device to test this on, it's
   * impossible to know by how much. */
  .titlebar-button > .toolbarbutton-icon {
    width: 10.8px;
    height: 10.8px;
  }
}

/* Bookmark menus */

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

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

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

    > .toolbarbutton-text,
    > .menu-iconic-left > .menu-iconic-text {
      opacity: 0.7;
    }
  }

  &:is(toolbarbutton)[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");
}

/* Address bar */

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

/* stylelint-disable-next-line media-query-no-invalid */
@media (-moz-bool-pref: "browser.urlbar.experimental.expandTextOnFocus") {
  #urlbar[breakout-extend] {
    font-size: 1.25em;
  }
}

@media (prefers-contrast) {
  :root {
    /* 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. */
    --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;
  }
}

/* Autocomplete */

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

/* Tabstrip */

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

@media (prefers-contrast) {
  /* For high contrast themes. XXX is this needed anymore? */
  #tabbrowser-tabpanels,
  :root[privatebrowsingmode=temporary] #tabbrowser-tabpanels {
    background-color: -moz-default-background-color;
  }
}

/* All tabs menupopup */

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

#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);
}

/* 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 {
  padding-inline: 0;
}