Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added rtl support #286

Merged
merged 3 commits into from Apr 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/css/wizard-navigation-bar.scss
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;
}
madoar marked this conversation as resolved.
Show resolved Hide resolved
madoar marked this conversation as resolved.
Show resolved Hide resolved
}

// 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