mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(rtl): add sass var $include-rtl
This commit is contained in:
@@ -220,3 +220,17 @@ ion-item-divider {
|
||||
ion-item-sliding {
|
||||
background-color: $item-ios-sliding-content-bg;
|
||||
}
|
||||
|
||||
// iOS item right-to-left
|
||||
// --------------------------------------------------
|
||||
@if $include-rtl {
|
||||
@at-root {
|
||||
|
||||
.rtl.ios {
|
||||
|
||||
// todo
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,3 +5,7 @@
|
||||
|
||||
// Global Mixins
|
||||
@import "util/mixins";
|
||||
|
||||
|
||||
// Global include-rtl
|
||||
$include-rtl: true !default;
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
if (location.href.indexOf('cordova=true') > -1) {
|
||||
window.cordova = {};
|
||||
}
|
||||
if (location.href.indexOf('rtl=true') > -1) {
|
||||
document.dir = 'rtl';
|
||||
} else {
|
||||
document.dir = 'ltr';
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@@ -88,6 +93,12 @@
|
||||
</ion-app>
|
||||
|
||||
<script>
|
||||
if (document.dir === 'rtl') {
|
||||
document.body.classList.add('rtl');
|
||||
} else {
|
||||
document.body.classList.remove('rtl');
|
||||
}
|
||||
|
||||
System.import('index.js').then(function(m) {}, console.error.bind(console));
|
||||
console.timeEnd('script init');
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user