summaryrefslogtreecommitdiffstats
path: root/browser/themes/shared/downloads/progressmeter.inc.css
blob: a775517754e56cacf64748c7ebcc122bb635b05a (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
/* 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/. */

/*** Common-styled progressmeter ***/

/*
 * Styling "html:progress" is limited by the fact that a number of properties
 * are intentionally locked at the UA stylesheet level. We have to use a border
 * instead of an outline because the latter would be drawn over the progress
 * bar and we cannot change its z-index. This means we have to use a negative
 * margin, except when the value is zero, and adjust the width calculation for
 * the indeterminate state.
 */

.downloadProgress {
  appearance: none;
  display: -moz-box;
  margin: 4px 0 0;
  margin-inline-end: 12px;
  border: 1px solid ButtonShadow;
  height: 6px;
  background-color: ButtonFace;
}

.downloadProgress::-moz-progress-bar {
  appearance: none;
  background-color: Highlight;
}

.downloadProgress[paused]::-moz-progress-bar {
  background-color: GrayText;
}

.downloadProgress:not([value="0"])::-moz-progress-bar {
  margin: -1px;
  height: 8px;
}

.downloadProgress:indeterminate::-moz-progress-bar {
  width: calc(100% + 2px);
  /* Make a white reflecting animation.
     Create a gradient with 2 identical pattern, and enlarge the size to 200%.
     This allows us to animate background-position with percentage. */
  background-image: linear-gradient(90deg, transparent 0%,
                                           rgba(255,255,255,0.5) 25%,
                                           transparent 50%,
                                           rgba(255,255,255,0.5) 75%,
                                           transparent 100%);
  background-blend-mode: lighten;
  background-size: 200% 100%;
  animation: downloadProgressSlideX 1.5s linear infinite;
}

@keyframes downloadProgressSlideX {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: -100% 0;
  }
}