Skip to content

Commit fb4353c

Browse files
committed
feat(dir): default to ltr css, rtl overrides w/ [dir=rtl] selectors
1 parent 093fcf5 commit fb4353c

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

core/src/themes/ionic.globals.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
@import "./ionic.mixins";
2222

2323
// Global app direction
24-
$app-direction: ltr !default;
24+
$app-direction: null !default;
2525

2626

2727
// Global font path

core/src/themes/ionic.mixins.scss

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,15 @@
158158
}
159159
}
160160

161+
162+
// Text Direction - ltr / rtl
163+
// $app-direction: multi | rtl | ltr | null (default)
164+
// multi: Both [dir=ltr] and [dir=rtl] are applied to css selectors.
165+
// rtl: Always assumes rtl and only includes rtl css. No [dir] selectors.
166+
// ltr: Always assumes ltr and only includes ltr css. No [dir] selectors.
167+
// null: CSS defaults to use the ltr css, and adds [dir=rtl] selectors to override ltr defaults.
168+
// ----------------------------------------------------------
169+
161170
@mixin multi-dir() {
162171
@if $app-direction == multi {
163172
$root: #{&};
@@ -172,7 +181,7 @@
172181
}
173182

174183
@mixin rtl() {
175-
@if $app-direction == multi {
184+
@if $app-direction == multi or $app-direction == null {
176185
$root: #{&};
177186
@at-root [dir="rtl"] {
178187
#{$root} {
@@ -192,7 +201,7 @@
192201
@content;
193202
}
194203
}
195-
} @else if $app-direction == ltr {
204+
} @else if $app-direction == ltr or $app-direction == null {
196205
@content;
197206
}
198207
}

0 commit comments

Comments
 (0)