6
6
$fallbacks : m3-progress-bar .get-tokens ();
7
7
8
8
.mat-mdc-progress-bar {
9
+ --mat-progress-bar-animation-multiplier : 1 ;
10
+
9
11
// Explicitly set to `block` since the browser defaults custom elements to `inline`.
10
12
display : block ;
11
13
@@ -35,6 +37,12 @@ $fallbacks: m3-progress-bar.get-tokens();
35
37
}
36
38
}
37
39
40
+ // Slow down the animation by 100% when the user configured their OS to reduce
41
+ // motion since some animations like the indeterminate one can be quite dynamic.
42
+ .mat-progress-bar-reduced-motion {
43
+ --mat-progress-bar-animation-multiplier : 2 ;
44
+ }
45
+
38
46
.mdc-linear-progress {
39
47
position : relative ;
40
48
width : 100% ;
@@ -105,15 +113,17 @@ $fallbacks: m3-progress-bar.get-tokens();
105
113
background-repeat : repeat-x ;
106
114
flex : auto ;
107
115
transform : rotate (180deg );
108
- animation : mdc- linear- progress- buffering 250ms infinite linear ;
116
+ animation : mdc- linear- progress- buffering
117
+ calc (250ms * var (--mat-progress-bar-animation-multiplier )) infinite linear ;
109
118
background-color : token-utils .slot (progress-bar-track-color , $fallbacks );
110
119
111
120
@include cdk .high-contrast {
112
121
background-color : ButtonBorder;
113
122
}
114
123
115
124
[dir = ' rtl' ] & {
116
- animation : mdc- linear- progress- buffering- reverse 250ms infinite linear ;
125
+ animation : mdc- linear- progress- buffering- reverse
126
+ calc (250ms * var (--mat-progress-bar-animation-multiplier )) infinite linear ;
117
127
transform : rotate (0 );
118
128
}
119
129
}
@@ -132,12 +142,14 @@ $fallbacks: m3-progress-bar.get-tokens();
132
142
}
133
143
134
144
.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready & {
135
- animation : mdc- linear- progress- primary- indeterminate- translate 2s infinite linear ;
145
+ animation : mdc- linear- progress- primary- indeterminate- translate
146
+ calc (2s * var (--mat-progress-bar-animation-multiplier )) infinite linear ;
136
147
}
137
148
138
149
.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready & {
139
150
> .mdc-linear-progress__bar-inner {
140
- animation : mdc- linear- progress- primary- indeterminate- scale 2s infinite linear ;
151
+ animation : mdc- linear- progress- primary- indeterminate- scale
152
+ calc (2s * var (--mat-progress-bar-animation-multiplier )) infinite linear ;
141
153
}
142
154
}
143
155
@@ -160,12 +172,14 @@ $fallbacks: m3-progress-bar.get-tokens();
160
172
}
161
173
162
174
.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready & {
163
- animation : mdc- linear- progress- secondary- indeterminate- translate 2s infinite linear ;
175
+ animation : mdc- linear- progress- secondary- indeterminate- translate
176
+ calc (2s * var (--mat-progress-bar-animation-multiplier )) infinite linear ;
164
177
}
165
178
166
179
.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready & {
167
180
> .mdc-linear-progress__bar-inner {
168
- animation : mdc- linear- progress- secondary- indeterminate- scale 2s infinite linear ;
181
+ animation : mdc- linear- progress- secondary- indeterminate- scale
182
+ calc (2s * var (--mat-progress-bar-animation-multiplier )) infinite linear ;
169
183
}
170
184
}
171
185
0 commit comments