Skip to content

Commit

Permalink
Added rtl support (#286)
Browse files Browse the repository at this point in the history
* added "rtl" support for horizontal and vertical wizard layouts
  • Loading branch information
KarimTayie authored Apr 26, 2020
1 parent b606541 commit 05ee884
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/css/wizard-navigation-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ $aw-param-indicator-state: null;
// wizard step state: 'default', 'current', 'done' etc.
$aw-param-step-state: null;

@mixin rtl {
@at-root [dir="rtl"] #{&} {
@content;
}
}

// Defines the line that strings together circles representing wizard steps, in the horizontal layout
@mixin aw-horizontal-line($dot-width, $dot-height, $line-color) {
Expand All @@ -26,6 +31,11 @@ $aw-param-step-state: null;
width: calc(100% - #{$dot-width});
top: -($dot-height / 2);
left: calc(50% + #{$dot-width / 2});

@include rtl {
left: auto;
right: calc(50% + #{$dot-width / 2});
}
}

// Defines the line that strings together circles representing wizard steps, in the vertical layout
Expand All @@ -37,6 +47,11 @@ $aw-param-step-state: null;
top: $dot-height;
height: calc(100% - #{$dot-height});
width: 1px;

@include rtl {
left: auto;
right: -($dot-height / 2);
}
}

// Defines a circle representing a wizard step
Expand All @@ -55,12 +70,22 @@ $aw-param-step-state: null;
@mixin aw-circle-position-horizontal($dot-width, $dot-height, $dot-border-width) {
top: -$dot-height;
left: calc(50% - #{$dot-width / 2});

@include rtl {
left: auto;
right: calc(50% - #{$dot-width / 2});;
}
}

// Positions a circle in the vertical layout of the navigation bar
@mixin aw-circle-position-vertical($dot-width, $dot-height, $dot-border-width) {
top: 0;
left: -$dot-width;

@include rtl {
left: auto;
right: -$dot-width;
}
}

// Define a step indicator style like 'small', 'large-filled' etc.
Expand Down Expand Up @@ -97,6 +122,10 @@ $aw-param-step-state: null;
}
@else if ($layout == 'vertical') {
padding: ($aw-distance-between-steps / 2) ($aw-distance-between-steps / 2) ($aw-distance-between-steps / 2) ($aw-distance-between-steps / 2 + $height);

@include rtl {
padding: ($aw-distance-between-steps / 2) ($aw-distance-between-steps / 2 + $height) ($aw-distance-between-steps / 2) ($aw-distance-between-steps / 2);
}
}

li {
Expand Down Expand Up @@ -408,6 +437,12 @@ aw-wizard-navigation-bar {
.label {
margin-left: $aw-text-margin-left;
text-align: left;

@include rtl {
margin-left: 0;
margin-right: $aw-text-margin-left;
text-align: right;
}
}
}
}
Expand Down

0 comments on commit 05ee884

Please # to comment.