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

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

/**
 * We intentionally do not include browser-custom-colors.css,
 * instead choosing to fall back to system colours and transparencies
 * in order to accomodate the wider variety of system themes on that
 * platform.
 */

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

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

:root:not(:-moz-lwtheme),
toolbar[brighttext]:not(:-moz-lwtheme) {
  --tab-attention-icon-color: AccentColor;
}

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

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

#navigator-toolbox {
  appearance: none;
  background-color: transparent;
  border-top: none;
}

.browser-toolbar {
  padding: 0;
}

.browser-toolbar:not(.titlebar-color) {
  background-color: var(--toolbar-bgcolor);
  color: var(--toolbar-color);
  appearance: none;
  border-style: none;
}

#nav-bar:not([tabs-hidden="true"]) {
  box-shadow: 0 calc(-1 * var(--tabs-navbar-shadow-size)) 0 var(--lwt-tabs-border-color, rgba(0,0,0,.3));
  /* This is needed for some toolbar button animations. Gross :( */
  position: relative;
}

/* 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 drag and drop styles */
.bookmark-item[dragover-into="true"] {
  background: SelectedItem !important;
  color: SelectedItemText !important;
}

.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 */
#urlbar,
#searchbar {
  font-size: 1.05em;
}

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

:root {
  --toolbar-field-border-color: ThreeDShadow;
}

/* Address bar results view */

:root:not(:-moz-lwtheme) {
  --urlbar-popup-action-color: -moz-nativehyperlinktext;
  --autocomplete-popup-highlight-background: SelectedItem;
  --autocomplete-popup-highlight-color: SelectedItemText;
}

/* AutoComplete */

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

/* Content area */


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

.sidebar-splitter {
  appearance: none;
  width: 6px;
  background-color: -moz-dialog;
  border: 1px ThreeDShadow;
  border-style: none solid;
}

/* Tabstrip */

#tabbrowser-tabs {
  /* override the global style to allow the selected tab to be above the nav-bar */
  z-index: auto;
}

#TabsToolbar {
  min-height: 0;
}

#titlebar {
  background-color: ActiveCaption;
  color: CaptionText;
}

#titlebar:-moz-window-inactive {
  background-color: InactiveCaption;
  color: InactiveCaptionText;
}

#TabsToolbar,
#toolbar-menubar,
#main-menubar,
#titlebar:-moz-lwtheme {
  appearance: none;
  background-color: transparent;
  color: inherit;
}

#context_reloadTab {
  list-style-image: url("moz-icon://stock/gtk-refresh?size=menu");
}

#context_closeOtherTabs {
  list-style-image: url("moz-icon://stock/gtk-clear?size=menu");
}

#context_closeOtherTabs[disabled] {
  list-style-image: url("moz-icon://stock/gtk-clear?size=menu&state=disabled");
}

#context_undoCloseTab {
  list-style-image: url("moz-icon://stock/gtk-undelete?size=menu");
}

#context_closeTab {
  list-style-image: url("moz-icon://stock/gtk-close?size=menu");
}

/* All tabs menupopup */

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

/* Status panel */

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

@media (-moz-content-prefers-color-scheme: dark) {
  #statuspanel-label {
    color-scheme: dark;
  }
}

#statuspanel:not([mirror]) > #statuspanel-label:-moz-locale-dir(ltr),
#statuspanel[mirror] > #statuspanel-label:-moz-locale-dir(rtl) {
  border-right-style: solid;
  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;
  border-top-left-radius: .3em;
  margin-left: 1em;
}


#UITourHighlight {
  /* Below are some fixes for people without an X compositor on Linux.
     This is why we can't have nice things: */
  /* Animations don't repaint properly without an X compositor. */
  animation-name: none !important;
  /* Opacity rounds to 0 or 1 on Linux without an X compositor, making the
     background color not visible. Anti-aliasing is not available either. Make a
     thicker outline and cancel border-radius for that case. */
     outline: 4px solid rgb(0,200,215);
     border-radius: 0 !important;
}

#UITourTooltipDescription {
  font-size: 1.05rem;
}

#UITourTooltipClose {
  margin-inline-end: -4px;
}

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

#context-navigation > .menuitem-iconic > .menu-iconic-left {
  /* override toolkit/themes/linux/global/menu.css */
  padding-inline-end: 0 !important;
  margin-inline-end: 0 !important;
}

/**
 * Titlebar drawing:
 *
 * We draw to titlebar when Gkt+ CSD is available. This is mostly
 * straight-forward, but getting the window corners to look perfect is a bit
 * tricky, as there are different variables to take into account.
 *
 * GTK windows have both a window radius (exposed via the
 * `-moz-gtk-csd-titlebar-radius`) environment variable, and a window shadow
 * (which we can't read back from GTK). Note that the native drawing does draw
 * the shadow already.
 *
 * So there are multiple configurations to consider:
 *
 *  * Whether we're using Wayland vs. X11
 *  * Whether we're using a lightweight theme or not.
 *
 * Consider the simple case (default system theme). We render the titlebar
 * using `-moz-default-appearance: -moz-window-titlebar;`, then don't draw
 * anything else. Success!
 *
 * Now consider lightweight themes: We need to render the native titlebar
 * behind the "theme" titlebar in order to render the native shadow on X11. But
 * we can't just use the #navigator-toolbox as that's where the lightweight
 * theme background goes, so we need to use the #navigator-toolbox-background.
 * We still have to apply the corner radii to #navigator-toolbox of course, so
 * the lightweight theme background doesn't overflow the titlebar radius.
 *
 * In a Wayland-only world, the setup could be much simpler: We could apply the
 * titlebar appearance to #navigator-toolbox, and just apply the border radius
 * on the <body> or #navigator-toolbox-background to clip the extra shadow when
 * using the system theme. For the lightweight theme, we could use
 * appearance: none and the titlebar radius on the toolbox. In X11 however, we
 * do need the native titlebar behind at all times.
 */
@media (-moz-gtk-csd-available) {
  :root[tabsintitlebar][sizemode="normal"] {
    background-color: transparent;
  }

  :root[tabsintitlebar] #navigator-toolbox-background {
    appearance: auto;
    -moz-default-appearance: -moz-window-titlebar-maximized;
  }

  :root[tabsintitlebar][sizemode="normal"]:not([gtktiledwindow="true"]) #navigator-toolbox-background {
    -moz-default-appearance: -moz-window-titlebar;
  }

  :root[tabsintitlebar] #titlebar {
    /* Use the toolbox background */
    background-color: transparent;
  }

  :root[tabsintitlebar][sizemode="normal"]:not([gtktiledwindow="true"]) #navigator-toolbox:-moz-lwtheme,
  :root[tabsintitlebar][sizemode="normal"]:not([gtktiledwindow="true"]) dialog::backdrop {
    border-top-left-radius: env(-moz-gtk-csd-titlebar-radius);
    border-top-right-radius: env(-moz-gtk-csd-titlebar-radius);
  }

  /* 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) + 2 * var(--tab-block-margin));
  }

  /* 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. */
  .titlebar-buttonbox {
    z-index: 1;
    align-items: center;
  }

  /* Render titlebar command buttons according to system config.
   * Use full scale icons here as the Gtk+ does. */
  .titlebar-min {
    appearance: auto;
    -moz-default-appearance: -moz-window-button-minimize;
    order: env(-moz-gtk-csd-minimize-button-position);
  }
  .titlebar-max {
    appearance: auto;
    -moz-default-appearance: -moz-window-button-maximize;
    order: env(-moz-gtk-csd-maximize-button-position);
  }
  .titlebar-restore {
    appearance: auto;
    -moz-default-appearance: -moz-window-button-restore;
    order: env(-moz-gtk-csd-maximize-button-position);
  }
  .titlebar-close {
    appearance: auto;
    -moz-default-appearance: -moz-window-button-close;
    order: env(-moz-gtk-csd-close-button-position);
  }

  /* When using lightweight themes, use our own buttons since native ones might
   * assume a native background in order to be visible. */
  .titlebar-button:-moz-lwtheme {
    appearance: none;
    border-radius: 100%;
  }
  .titlebar-button > .toolbarbutton-icon:-moz-lwtheme {
    padding: 6px;
    -moz-context-properties: stroke;
    stroke: currentColor;
  }
  .titlebar-min:-moz-lwtheme {
    list-style-image: url(chrome://browser/skin/window-controls/minimize.svg);
  }
  .titlebar-max:-moz-lwtheme {
    list-style-image: url(chrome://browser/skin/window-controls/maximize.svg);
  }
  .titlebar-restore:-moz-lwtheme {
    list-style-image: url(chrome://browser/skin/window-controls/restore.svg);
  }
  .titlebar-close:-moz-lwtheme {
    list-style-image: url(chrome://browser/skin/window-controls/close.svg);
  }
  .titlebar-button:-moz-lwtheme:hover {
    background-color: color-mix(in srgb, currentColor 12%, transparent);
  }
  .titlebar-button:-moz-lwtheme:hover:active {
    background-color: color-mix(in srgb, currentColor 20%, transparent);
  }
  .titlebar-close:-moz-lwtheme:hover {
    background-color: #d70022;
    color: white;
  }
  .titlebar-close:-moz-lwtheme:hover:active {
    background-color: #ff0039;
  }

  @media not (-moz-gtk-csd-minimize-button) {
    .titlebar-min {
      display: none;
    }
  }
  @media not (-moz-gtk-csd-maximize-button) {
    .titlebar-restore,
    .titlebar-max {
      display: none;
    }
  }
  @media not (-moz-gtk-csd-close-button) {
    .titlebar-close {
      display: none;
    }
  }

  @media (-moz-gtk-csd-reversed-placement) {
    .titlebar-buttonbox-container {
      order: -1;
    }
  }
}