mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +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";
|
@import "./ionic.mixins";
|
||||||
|
|
||||||
// Global app direction
|
// Global app direction
|
||||||
$app-direction: ltr !default;
|
$app-direction: null !default;
|
||||||
|
|
||||||
|
|
||||||
// Global font path
|
// 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() {
|
@mixin multi-dir() {
|
||||||
@if $app-direction == multi {
|
@if $app-direction == multi {
|
||||||
$root: #{&};
|
$root: #{&};
|
||||||
@ -172,7 +181,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@mixin rtl() {
|
@mixin rtl() {
|
||||||
@if $app-direction == multi {
|
@if $app-direction == multi or $app-direction == null {
|
||||||
$root: #{&};
|
$root: #{&};
|
||||||
@at-root [dir="rtl"] {
|
@at-root [dir="rtl"] {
|
||||||
#{$root} {
|
#{$root} {
|
||||||
@ -192,7 +201,7 @@
|
|||||||
@content;
|
@content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} @else if $app-direction == ltr {
|
} @else if $app-direction == ltr or $app-direction == null {
|
||||||
@content;
|
@content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user