From fb4353c97d52bee564016709e779174379e7026d Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Tue, 22 May 2018 12:08:45 -0500 Subject: [PATCH] feat(dir): default to ltr css, rtl overrides w/ [dir=rtl] selectors --- core/src/themes/ionic.globals.scss | 2 +- core/src/themes/ionic.mixins.scss | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/core/src/themes/ionic.globals.scss b/core/src/themes/ionic.globals.scss index 0091339fe5..3a7a96776b 100644 --- a/core/src/themes/ionic.globals.scss +++ b/core/src/themes/ionic.globals.scss @@ -21,7 +21,7 @@ @import "./ionic.mixins"; // Global app direction -$app-direction: ltr !default; +$app-direction: null !default; // Global font path diff --git a/core/src/themes/ionic.mixins.scss b/core/src/themes/ionic.mixins.scss index 1343dbd699..4bdc64f31f 100644 --- a/core/src/themes/ionic.mixins.scss +++ b/core/src/themes/ionic.mixins.scss @@ -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; } }