mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-06 22:29:44 +08:00
feat(dir): default to ltr css, rtl overrides w/ [dir=rtl] selectors
This commit is contained in:
@ -21,7 +21,7 @@
|
||||
@import "./ionic.mixins";
|
||||
|
||||
// Global app direction
|
||||
$app-direction: ltr !default;
|
||||
$app-direction: null !default;
|
||||
|
||||
|
||||
// Global font path
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user