Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_progress.scss « scss - github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9c633a525a6cfdf7570b3c1e5578f58119fdcf30 (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
//
// Progress animations
//

@keyframes progress-bar-stripes {
  from  { background-position: $spacer-y 0; }
  to    { background-position: 0 0; }
}


//
// Basic progress bar
//

.progress {
  display: block;
  width: 100%;
  height: $spacer-y; // todo: make a new var for this
  margin-bottom: $spacer-y;
}
.progress[value] {
  // Set overall background
  background-color: #eee;
  // Remove Firefox and Opera border
  border: 0;
  // Reset the default appearance
  appearance: none;
  // Set overall border radius
  @include border-radius($border-radius);
}
.progress[value]::-ms-fill {
  background-color: $progress-bar-color;
  // Remove right-hand border of value bar from IE10+/Edge
  border: 0;
}
.progress[value]::-webkit-progress-bar {
  background-color: #eee;
  @include border-radius($border-radius);
  @include box-shadow(inset 0 .1rem .1rem rgba(0,0,0,.1));
}
.progress[value]::-webkit-progress-value {
  background-color: $progress-bar-color;
  border-top-left-radius: $border-radius;
  border-bottom-left-radius: $border-radius;
}
.progress[value="100"]::-webkit-progress-value {
  border-top-right-radius: $border-radius;
  border-bottom-right-radius: $border-radius;
}

// Firefox styles must be entirely separate or it busts Webkit styles.
//
// Commented out for now because linter.
//
// $-moz-document url-prefix() {
//   .progress[value] {
//     background-color: #eee;
//     .border-radius($border-radius);
//     .box-shadow(inset 0 .1rem .1rem rgba(0,0,0,.1));
//   }
//   .progress[value]::-moz-progress-bar {
//     background-color: $progress-bar-color;
//     border-top-left-radius: $border-radius;
//     border-bottom-left-radius: $border-radius;
//   }
//   .progress[value="0"]::-moz-progress-bar {
//     color: $gray-light;
//     min-width: 2rem;
//     background-color: transparent;
//     background-image: none;
//   }
//   .progress[value="100"]::-moz-progress-bar {
//     border-top-right-radius: $border-radius;
//     border-bottom-right-radius: $border-radius;
//   }
// }

// IE9 hacks to accompany custom markup. We don't need to scope this via media queries, but I feel better doing it anyway.
@media screen and (min-width:0\0) {
  .progress {
    background-color: #eee;
    @include border-radius($border-radius);
    @include box-shadow(inset 0 .1rem .1rem rgba(0,0,0,.1));
  }
  .progress-bar {
    display: inline-block;
    height: $spacer-y;
    text-indent: -999rem; // Simulate hiding of value as in native `<progress>`
    background-color: $progress-bar-color;
    border-top-left-radius: $border-radius;
    border-bottom-left-radius: $border-radius;
  }
  .progress[width^="0"] {
    min-width: 2rem;
    color: $gray-light;
    background-color: transparent;
    background-image: none;
  }
  .progress[width="100%"] {
    border-top-right-radius: $border-radius;
    border-bottom-right-radius: $border-radius;
  }
}


//
// Striped
//

.progress-striped[value]::-webkit-progress-value {
  @include gradient-striped();
  background-size: $spacer-y $spacer-y;
}
.progress-striped[value]::-moz-progress-bar {
  @include gradient-striped();
  background-size: $spacer-y $spacer-y;
}
.progress-striped[value]::-ms-fill {
  @include gradient-striped();
  background-size: $spacer-y $spacer-y;
}
// IE9
@media screen and (min-width:0\0) {
  .progress-bar-striped {
    @include gradient-striped();
    background-size: $spacer-y $spacer-y;
  }
}


//
// Animated
//

.progress-animated[value]::-webkit-progress-value {
  animation: progress-bar-stripes 2s linear infinite;
}
.progress-animated[value]::-moz-progress-bar {
  animation: progress-bar-stripes 2s linear infinite;
}
// IE9
@media screen and (min-width:0\0) {
  .progress-animated .progress-bar-striped {
    animation: progress-bar-stripes 2s linear infinite;
  }
}


//
// Variations
//

.progress-success {
  @include progress-variant($progress-bar-success-bg);
}
.progress-info {
  @include progress-variant($progress-bar-info-bg);
}
.progress-warning {
  @include progress-variant($progress-bar-warning-bg);
}
.progress-danger {
  @include progress-variant($progress-bar-danger-bg);
}