Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/base/browser/ui/progressbar/progressbar.css
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
.monaco-progress-container {
7
width: 100%;
8
height: 2px;
9
overflow: hidden; /* keep progress bit in bounds */
10
}
11
12
.monaco-progress-container .progress-bit {
13
width: 2%;
14
height: 2px;
15
position: absolute;
16
left: 0;
17
display: none;
18
}
19
20
.monaco-progress-container.active .progress-bit {
21
display: inherit;
22
}
23
24
.monaco-progress-container.discrete .progress-bit {
25
left: 0;
26
transition: width 100ms linear;
27
}
28
29
.monaco-progress-container.discrete.done .progress-bit {
30
width: 100%;
31
}
32
33
.monaco-progress-container.infinite .progress-bit {
34
animation-name: progress;
35
animation-duration: 4s;
36
animation-iteration-count: infinite;
37
transform: translate3d(0px, 0px, 0px);
38
animation-timing-function: linear;
39
}
40
41
.monaco-progress-container.infinite.infinite-long-running .progress-bit {
42
/*
43
The more smooth `linear` timing function can cause
44
higher GPU consumption as indicated in
45
https://github.com/microsoft/vscode/issues/97900 &
46
https://github.com/microsoft/vscode/issues/138396
47
*/
48
animation-timing-function: steps(100);
49
}
50
51
/**
52
* The progress bit has a width: 2% (1/50) of the parent container. The animation moves it from 0% to 100% of
53
* that container. Since translateX is relative to the progress bit size, we have to multiple it with
54
* its relative size to the parent container:
55
* parent width: 5000%
56
* bit width: 100%
57
* translateX should be as follow:
58
* 50%: 5000% * 50% - 50% (set to center) = 2450%
59
* 100%: 5000% * 100% - 100% (do not overflow) = 4900%
60
*/
61
@keyframes progress { from { transform: translateX(0%) scaleX(1) } 50% { transform: translateX(2500%) scaleX(3) } to { transform: translateX(4900%) scaleX(1) } }
62
63