feat(dir): default to ltr css, rtl overrides w/ [dir=rtl] selectors

This commit is contained in:
Adam Bradley
2018-05-22 12:08:45 -05:00
parent 093fcf540b
commit fb4353c97d
2 changed files with 12 additions and 3 deletions

View File

@ -21,7 +21,7 @@
@import "./ionic.mixins";
// Global app direction
$app-direction: ltr !default;
$app-direction: null !default;
// Global font path

View File

@ -158,6 +158,15 @@
}
}
// Text Direction - ltr / rtl
// $app-direction: multi | rtl | ltr | null (default)
// multi: Both [dir=ltr] and [dir=rtl] are applied to css selectors.
// rtl: Always assumes rtl and only includes rtl css. No [dir] selectors.
// ltr: Always assumes ltr and only includes ltr css. No [dir] selectors.
// null: CSS defaults to use the ltr css, and adds [dir=rtl] selectors to override ltr defaults.
// ----------------------------------------------------------
@mixin multi-dir() {
@if $app-direction == multi {
$root: #{&};
@ -172,7 +181,7 @@
}
@mixin rtl() {
@if $app-direction == multi {
@if $app-direction == multi or $app-direction == null {
$root: #{&};
@at-root [dir="rtl"] {
#{$root} {
@ -192,7 +201,7 @@
@content;
}
}
} @else if $app-direction == ltr {
} @else if $app-direction == ltr or $app-direction == null {
@content;
}
}