|
18 | 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19 | 19 | // THE SOFTWARE.
|
20 | 20 |
|
| 21 | +// stylelint-disable no-unknown-animations -- |
| 22 | +// Animations keyframes are included in `keyframes.scss`. |
| 23 | +// stylelint-disable selector-class-pattern -- |
| 24 | +// Selector '.mdc-*' should only be used in this project. |
| 25 | + |
21 | 26 | @use 'sass:string';
|
22 | 27 | @use '@material/animation/functions' as animation-functions;
|
23 | 28 | @use '@material/feature-targeting/feature-targeting';
|
| 29 | +@use '@material/rtl/rtl'; |
24 | 30 | @use '@material/theme/theme';
|
25 | 31 | @use '@material/theme/theme-color';
|
26 | 32 | @use './variables';
|
|
133 | 139 | @include indeterminate_($query: $query);
|
134 | 140 | @include reversed_($query: $query);
|
135 | 141 |
|
| 142 | + @include rtl.rtl() { |
| 143 | + @include _rtl-styles($query: $query); |
| 144 | + } |
| 145 | + |
136 | 146 | &--closed {
|
137 | 147 | @include feature-targeting.targets($feat-structure) {
|
138 | 148 | opacity: 0;
|
|
161 | 171 | @include bar-color(primary, $query: $query);
|
162 | 172 | @include buffer-color(variables.$baseline-buffer-color, $query: $query);
|
163 | 173 | }
|
164 |
| - |
165 |
| - .mdc-linear-progress--indeterminate.mdc-linear-progress--reversed { |
166 |
| - .mdc-linear-progress__primary-bar { |
167 |
| - @include feature-targeting.targets($feat-structure) { |
168 |
| - right: -145.166611%; |
169 |
| - left: auto; |
170 |
| - } |
171 |
| - } |
172 |
| - |
173 |
| - .mdc-linear-progress__secondary-bar { |
174 |
| - @include feature-targeting.targets($feat-structure) { |
175 |
| - right: -54.888891%; |
176 |
| - left: auto; |
177 |
| - } |
178 |
| - } |
179 |
| - } |
180 | 174 | }
|
181 | 175 |
|
182 | 176 | @mixin bar-color($color, $query: feature-targeting.all()) {
|
|
276 | 270 | }
|
277 | 271 | }
|
278 | 272 |
|
| 273 | +/// @deprecated - this will soon be removed in favor of auto-reversal in RTL. |
279 | 274 | @mixin reversed_($query: feature-targeting.all()) {
|
280 | 275 | $feat-structure: feature-targeting.create-target($query, structure);
|
281 |
| - $feat-animation: feature-targeting.create-target($query, animation); |
282 | 276 |
|
283 | 277 | &--reversed {
|
284 |
| - .mdc-linear-progress__bar { |
| 278 | + @include _rtl-styles($query: $query); |
| 279 | + |
| 280 | + .mdc-linear-progress__buffer-dots { |
285 | 281 | @include feature-targeting.targets($feat-structure) {
|
286 |
| - right: 0; |
287 |
| - transform-origin: center right; |
| 282 | + order: 0; |
288 | 283 | }
|
289 | 284 | }
|
290 | 285 |
|
291 |
| - &.mdc-linear-progress--animation-ready { |
292 |
| - .mdc-linear-progress__primary-bar { |
293 |
| - @include feature-targeting.targets($feat-animation) { |
294 |
| - animation-name: mdc-linear-progress-primary-indeterminate-translate-reverse; |
295 |
| - } |
| 286 | + .mdc-linear-progress__buffer-bar { |
| 287 | + @include feature-targeting.targets($feat-structure) { |
| 288 | + order: 1; |
296 | 289 | }
|
| 290 | + } |
| 291 | + } |
| 292 | +} |
297 | 293 |
|
298 |
| - .mdc-linear-progress__secondary-bar { |
299 |
| - @include feature-targeting.targets($feat-animation) { |
300 |
| - animation-name: mdc-linear-progress-secondary-indeterminate-translate-reverse; |
301 |
| - } |
| 294 | +@mixin _rtl-styles($query: $query) { |
| 295 | + $feat-structure: feature-targeting.create-target($query, structure); |
| 296 | + $feat-animation: feature-targeting.create-target($query, animation); |
| 297 | + |
| 298 | + .mdc-linear-progress__bar { |
| 299 | + @include feature-targeting.targets($feat-structure) { |
| 300 | + /* @noflip */ |
| 301 | + right: 0; |
| 302 | + /* @noflip */ |
| 303 | + transform-origin: center right; |
| 304 | + } |
| 305 | + } |
| 306 | + |
| 307 | + &.mdc-linear-progress--animation-ready { |
| 308 | + .mdc-linear-progress__primary-bar { |
| 309 | + @include feature-targeting.targets($feat-animation) { |
| 310 | + animation-name: mdc-linear-progress-primary-indeterminate-translate-reverse; |
302 | 311 | }
|
303 | 312 | }
|
304 | 313 |
|
305 |
| - .mdc-linear-progress__buffer-dots { |
| 314 | + .mdc-linear-progress__secondary-bar { |
306 | 315 | @include feature-targeting.targets($feat-animation) {
|
307 |
| - animation: mdc-linear-progress-buffering-reverse 250ms infinite linear; |
| 316 | + animation-name: mdc-linear-progress-secondary-indeterminate-translate-reverse; |
308 | 317 | }
|
| 318 | + } |
| 319 | + } |
309 | 320 |
|
| 321 | + .mdc-linear-progress__buffer-dots { |
| 322 | + @include feature-targeting.targets($feat-animation) { |
| 323 | + animation: mdc-linear-progress-buffering-reverse 250ms infinite linear; |
| 324 | + } |
| 325 | + |
| 326 | + @include feature-targeting.targets($feat-structure) { |
| 327 | + transform: rotate(0); |
| 328 | + } |
| 329 | + } |
| 330 | + |
| 331 | + &.mdc-linear-progress--indeterminate { |
| 332 | + .mdc-linear-progress__primary-bar { |
310 | 333 | @include feature-targeting.targets($feat-structure) {
|
311 |
| - order: 0; |
312 |
| - transform: rotate(0); |
| 334 | + /* @noflip */ |
| 335 | + right: -145.166611%; |
| 336 | + /* @noflip */ |
| 337 | + left: auto; |
313 | 338 | }
|
314 | 339 | }
|
315 | 340 |
|
316 |
| - .mdc-linear-progress__buffer-bar { |
| 341 | + .mdc-linear-progress__secondary-bar { |
317 | 342 | @include feature-targeting.targets($feat-structure) {
|
318 |
| - order: 1; |
| 343 | + /* @noflip */ |
| 344 | + right: -54.888891%; |
| 345 | + /* @noflip */ |
| 346 | + left: auto; |
319 | 347 | }
|
320 | 348 | }
|
321 | 349 | }
|
|
0 commit comments