summaryrefslogtreecommitdiffstats
path: root/browser/themes/windows/browser-aero.css
blob: e5ace71f6532740b2902622960b9d9299dd8d108 (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
/* 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/. */

:root {
  --glass-active-border-color: rgb(37, 44, 51);
  --glass-inactive-border-color: rgb(102, 102, 102);
  --glass-shadow-color: hsla(240,5%,5%,0.3);
}

@media (-moz-platform: windows-win7),
       (-moz-platform: windows-win8) {
  @media (-moz-windows-classic: 0) {
    :root[sizemode="normal"] #toolbar-menubar:not([autohide="true"]) > #menubar-items,
    :root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .toolbar-items {
      margin-top: 1px;
    }
    /**
     * Except for Windows 8, Windows 7 Aero and Windows 7 Aero Basic, the
     * -moz-window-button-box appearance on the .titlebar-buttonbox adds an
     * unwanted margin at the top of the button box.
     *
     * For Windows 8 and Windows Aero (which both use the compositor):
     *   We want the -moz-window-button-box applied in the restored case,
     *   and -moz-window-button-box-maximized in the maximized case.
     *
     * For Windows Aero Basic:
     *   The margin is also unwanted in the maximized case, but we want
     *   it in the restored window case.
     */
    :root[sizemode="normal"] .titlebar-buttonbox {
      appearance: auto;
      -moz-default-appearance: -moz-window-button-box;
    }

    @media (-moz-windows-compositor) {
      :root[sizemode="maximized"] .titlebar-buttonbox {
        appearance: auto;
        -moz-default-appearance: -moz-window-button-box-maximized;
      }
    }
  }
}

@media (-moz-windows-compositor) {
  @media not (-moz-platform: windows-win7) {
    @media not (-moz-platform: windows-win8) {
      @media (-moz-windows-default-theme) {
        @media (-moz-windows-accent-color-in-titlebar) {
          :root[sizemode=normal][tabsintitlebar] #navigator-toolbox {
            border-top: .5px solid AccentColor;
          }
        }

        :root[sizemode=normal][tabsintitlebar]:-moz-window-inactive #navigator-toolbox {
          border-top-color: rgb(57,57,57);
        }

        :root[tabsintitlebar] .tab-label:-moz-window-inactive {
          /* Calculated to match the opacity change of Windows Explorer
             titlebar text change for inactive windows. */
          opacity: .6;
        }

        :root[tabsintitlebar] .tab-secondary-label:-moz-window-inactive {
          opacity: .6;
        }
      }

      /* See bug 1715990 about why we do this ourselves on HCM */
      @media (prefers-contrast) {
        :root[tabsintitlebar]:not(:-moz-lwtheme) {
          background-color: ActiveCaption;
          color: CaptionText;
        }

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

      .titlebar-buttonbox,
      .titlebar-button {
        appearance: none !important;
      }

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

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

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

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

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

      .titlebar-restore > .toolbarbutton-icon:-moz-locale-dir(rtl) {
        transform: scaleX(-1);
      }

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

      :root[lwtheme-image] .titlebar-button {
        -moz-context-properties: unset;
      }
      :root[lwtheme-image] .titlebar-min {
        list-style-image: url(chrome://browser/skin/window-controls/minimize-themes.svg);
      }
      :root[lwtheme-image] .titlebar-max {
        list-style-image: url(chrome://browser/skin/window-controls/maximize-themes.svg);
      }
      :root[lwtheme-image] .titlebar-restore {
        list-style-image: url(chrome://browser/skin/window-controls/restore-themes.svg);
      }
      :root[lwtheme-image] .titlebar-close {
        list-style-image: url(chrome://browser/skin/window-controls/close-themes.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 (min-resolution: 1.20dppx) and (max-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 (min-resolution: 1.70dppx) and (max-resolution: 1.95dppx) {
        .titlebar-button {
          padding-inline: 14.1px;
        }

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

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

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

      /* 275% dpi should result in the same device pixel sizes as 250% dpi. */
      @media (min-resolution: 2.70dppx) and (max-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;
        }
      }

      @media (-moz-windows-default-theme) {
        #main-menubar > menu[_moz-menuactive="true"] {
          color: inherit;
        }

        #main-menubar > menu[_moz-menuactive="true"],
        .titlebar-button:hover {
          background-color: hsla(0,0%,0%,.12);
        }
        .titlebar-button:hover:active {
          background-color: hsla(0,0%,0%,.22);
        }

        #toolbar-menubar[brighttext] > #menubar-items > #main-menubar > menu[_moz-menuactive="true"],
        toolbar[brighttext] .titlebar-button:not(.titlebar-close):hover {
          background-color: hsla(0,0%,100%,.22);
        }
        toolbar[brighttext] .titlebar-button:not(.titlebar-close):hover:active {
          background-color: hsla(0,0%,100%,.32);
        }

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

        .titlebar-button:not(:hover) > .toolbarbutton-icon:-moz-window-inactive {
          opacity: 0.5;
        }
      }

      @media (-moz-windows-default-theme: 0) {
        .titlebar-button {
          background-color: -moz-field;
          stroke: ButtonText;
        }
        .titlebar-button: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);
        }
      }
    }
  }

  @media (-moz-platform: windows-win7),
         (-moz-platform: windows-win8) {
    :root {
      background-color: transparent;
      appearance: auto;
      -moz-default-appearance: -moz-win-borderless-glass;
    }

    :root[sizemode="maximized"] .titlebar-buttonbox {
      margin-inline-end: 3px;
    }

    /* These should be hidden w/ glass enabled. Windows draws its own buttons. */
    .titlebar-button {
      display: none;
    }

    /* The borders on the glass frame are ours, and inside #browser, and on
     * win7 we want to make sure they are "glassy", so we can't use #browser
     * as the exclude-glass container. We use #appcontent instead. */
    #appcontent {
      appearance: auto;
      -moz-default-appearance: -moz-win-exclude-glass;
    }
  }

  @media (-moz-platform: windows-win8) {
    /* Artificially draw window borders that are covered by lwtheme, see bug 591930.
     * Borders for win7 are below, win10 only needs something like this when
     * drawing in the titlebar (-moz-windows-accent-color-in-titlebar). */
    #main-window[sizemode="normal"] #navigator-toolbox:-moz-lwtheme {
      border-top: 1px solid var(--glass-shadow-color);
    }
  }

  :root[darkwindowframe="true"]:not(:-moz-window-inactive, :-moz-lwtheme) {
    color: white;
  }

  #appcontent:not(:-moz-lwtheme) {
    background-color: -moz-dialog;
  }
}

@media (-moz-windows-glass) {
  #toolbar-menubar:not(:-moz-lwtheme) {
    text-shadow: 0 0 .5em white, 0 0 .5em white, 0 1px 0 rgba(255,255,255,.4);
  }

  #main-menubar:not(:-moz-lwtheme, :-moz-window-inactive) {
    background-color: rgba(255,255,255,.5);
    color: black;
    border-radius: 4px;
  }

  /* Artificially draw window borders that are covered by lwtheme, see bug 591930.
   * We use a different border for win8, and this win10+ only needs this if
   * drawing in the titlebar (-moz-windows-accent-color-in-titlebar). */
  #main-window[sizemode="normal"] #navigator-toolbox:-moz-lwtheme {
    border-top: 1px solid var(--glass-active-border-color);
    padding-top: 1px;
    box-shadow: 0 1px 0 rgba(255,255,255,.6) inset;
  }

  #main-window[sizemode="normal"] #navigator-toolbox:-moz-lwtheme:-moz-window-inactive {
    border-top-color: var(--glass-inactive-border-color);
  }
}

/* Aero Basic */
@media (-moz-windows-compositor: 0) {
  @media (-moz-windows-default-theme) {
    :root {
      background-color: rgb(185,209,234);
    }
    :root:-moz-window-inactive {
      background-color: rgb(215,228,242);
    }

    /* Render a window top border for lwthemes: */
    #main-window[tabsintitlebar][sizemode="normal"] #navigator-toolbox:-moz-lwtheme {
      background-image: linear-gradient(to bottom,
            var(--glass-active-border-color) 0, var(--glass-active-border-color) 1px,
            rgba(255,255,255,.6) 1px, rgba(255,255,255,.6) 2px, transparent 2px);
    }

    #main-window[tabsintitlebar][sizemode="normal"] #navigator-toolbox:-moz-lwtheme:-moz-window-inactive {
      background-image: linear-gradient(to bottom,
            var(--glass-inactive-border-color) 0, var(--glass-inactive-border-color) 1px,
            rgba(255,255,255,.6) 1px, rgba(255,255,255,.6) 2px, transparent 2px);
    }
  }

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