66$fallbacks : m3-progress-bar .get-tokens ();
77
88.mat-mdc-progress-bar {
9+ --mat-progress-bar-animation-multiplier : 1 ;
10+
911 // Explicitly set to `block` since the browser defaults custom elements to `inline`.
1012 display : block ;
1113
@@ -35,6 +37,12 @@ $fallbacks: m3-progress-bar.get-tokens();
3537 }
3638}
3739
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+
3846.mdc-linear-progress {
3947 position : relative ;
4048 width : 100% ;
@@ -105,15 +113,17 @@ $fallbacks: m3-progress-bar.get-tokens();
105113 background-repeat : repeat-x ;
106114 flex : auto ;
107115 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 ;
109118 background-color : token-utils .slot (progress-bar-track-color , $fallbacks );
110119
111120 @include cdk .high-contrast {
112121 background-color : ButtonBorder;
113122 }
114123
115124 [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 ;
117127 transform : rotate (0 );
118128 }
119129}
@@ -132,12 +142,14 @@ $fallbacks: m3-progress-bar.get-tokens();
132142 }
133143
134144 .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 ;
136147 }
137148
138149 .mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready & {
139150 > .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 ;
141153 }
142154 }
143155
@@ -160,12 +172,14 @@ $fallbacks: m3-progress-bar.get-tokens();
160172 }
161173
162174 .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 ;
164177 }
165178
166179 .mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready & {
167180 > .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 ;
169183 }
170184 }
171185
0 commit comments