Skip to content

Commit

Permalink
fix(progress-bar): flip rtl using the existing reversed property (#17464
Browse files Browse the repository at this point in the history
)

updates the progress bar to always use the ltr dir but take advantage of the reversed property when dir is rtl.

references #17012
  • Loading branch information
brandyscarney authored Mar 25, 2019
1 parent 34f6f1d commit fccaaf8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
26 changes: 22 additions & 4 deletions core/src/components/progress-bar/progress-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
width: 100%;

contain: strict;

direction: ltr;
overflow: hidden;
}

Expand All @@ -41,6 +43,7 @@
.progress-buffer-bar:before,
.buffer-circles {
@include position(0, 0, 0, 0);

position: absolute;

width: 100%;
Expand All @@ -52,7 +55,9 @@

.progress,
.progress-buffer-bar {
@include transform-origin(start, top);
/* stylelint-disable-next-line property-blacklist */
transform-origin: left top;

transition: transform 150ms linear;
}

Expand Down Expand Up @@ -84,7 +89,13 @@
// --------------------------------------------------

.indeterminate-bar-primary {
@include position(0, 0, 0, -145.166611%);
/* stylelint-disable property-blacklist */
top: 0;
right: 0;
bottom: 0;
left: -145.166611%;
/* stylelint-enable property-blacklist */

animation: primary-indeterminate-translate 2s infinite linear;

.progress-indeterminate {
Expand All @@ -94,7 +105,13 @@
}

.indeterminate-bar-secondary {
@include position(0, 0, 0, -54.888891%);
/* stylelint-disable property-blacklist */
top: 0;
right: 0;
bottom: 0;
left: -54.888891%;
/* stylelint-enable property-blacklist */

animation: secondary-indeterminate-translate 2s infinite linear;

.progress-indeterminate {
Expand All @@ -121,7 +138,8 @@
:host(.progress-bar-reversed) {
.progress,
.progress-buffer-bar {
@include transform-origin(end, top);
/* stylelint-disable-next-line property-blacklist */
transform-origin: right top;
}

.buffer-circles,
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/progress-bar/progress-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class ProgressBar implements ComponentInterface {
...createColorClasses(color),
[`progress-bar-${type}`]: true,
'progress-paused': paused,
'progress-bar-reversed': reversed,
'progress-bar-reversed': document.dir === 'rtl' ? !reversed : reversed
}
};
}
Expand Down

0 comments on commit fccaaf8

Please sign in to comment.