_platform.scss 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /**
  2. * Platform
  3. * --------------------------------------------------
  4. * Platform specific tweaks
  5. */
  6. .platform-ios.platform-cordova {
  7. // iOS has a status bar which sits on top of the header.
  8. // Bump down everything to make room for it. However, if
  9. // if its in Cordova, and set to fullscreen, then disregard the bump.
  10. &:not(.fullscreen) {
  11. .bar-header:not(.bar-subheader) {
  12. height: $bar-height + $ios-statusbar-height;
  13. height: calc(constant(safe-area-inset-top) + #{$bar-height});
  14. height: calc(env(safe-area-inset-top) + #{$bar-height});
  15. &.item-input-inset .item-input-wrapper {
  16. margin-top: 19px !important;
  17. }
  18. > * {
  19. margin-top: $ios-statusbar-height;
  20. margin-top: constant(safe-area-inset-top);
  21. margin-top: env(safe-area-inset-top);
  22. }
  23. }
  24. .bar-header {
  25. padding-left: calc(
  26. constant(safe-area-inset-left) + #{$bar-padding-portrait}
  27. );
  28. padding-left: calc(env(safe-area-inset-left) + #{$bar-padding-portrait});
  29. padding-right: calc(
  30. constant(safe-area-inset-right) + #{$bar-padding-portrait}
  31. );
  32. padding-right: calc(
  33. env(safe-area-inset-right) + #{$bar-padding-portrait}
  34. );
  35. .buttons:last-child {
  36. right: calc(constant(safe-area-inset-right) + #{$bar-padding-portrait});
  37. right: calc(env(safe-area-inset-right) + #{$bar-padding-portrait});
  38. }
  39. }
  40. .has-tabs, .bar-footer.has-tabs {
  41. bottom : calc(constant(safe-area-inset-bottom) + #{$tabs-height});
  42. bottom : calc(env(safe-area-inset-bottom) + #{$tabs-height});
  43. }
  44. .tabs-top > .tabs, .tabs.tabs-top {
  45. top: $bar-height + $ios-statusbar-height;
  46. }
  47. .tabs {
  48. padding-bottom: constant(safe-area-inset-bottom);
  49. padding-bottom: env(safe-area-inset-bottom);
  50. height: calc(constant(safe-area-inset-bottom) + 49px);
  51. height: calc(env(safe-area-inset-bottom) + 49px);
  52. }
  53. .has-header, .bar-subheader {
  54. top: $bar-height + $ios-statusbar-height;
  55. top: calc(constant(safe-area-inset-top) + #{$bar-height});
  56. top: calc(env(safe-area-inset-top) + #{$bar-height});
  57. }
  58. .has-subheader {
  59. top: $bar-height + $bar-subheader-height + $ios-statusbar-height;
  60. top: calc(constant(safe-area-inset-top) + #{$bar-height + $bar-subheader-height});
  61. top: calc(env(safe-area-inset-top) + #{$bar-height + $bar-subheader-height});
  62. }
  63. .has-header.has-tabs-top {
  64. top: $bar-height + $tabs-height + $ios-statusbar-height;
  65. top: calc(#{$bar-height + $tabs-height} + constant(safe-area-inset-top));
  66. top: calc(#{$bar-height + $tabs-height} + env(safe-area-inset-top));
  67. }
  68. .has-header.has-subheader.has-tabs-top {
  69. top: $bar-height + $bar-subheader-height + $tabs-height + $ios-statusbar-height;
  70. top: calc(#{$bar-height + $bar-subheader-height + $tabs-height} + constant(safe-area-inset-right);
  71. top: calc(#{$bar-height + $bar-subheader-height + $tabs-height} + env(safe-area-inset-right);
  72. }
  73. }
  74. .popover {
  75. .bar-header:not(.bar-subheader) {
  76. height: $bar-height;
  77. &.item-input-inset .item-input-wrapper {
  78. margin-top: -1px;
  79. }
  80. > * {
  81. margin-top: 0;
  82. }
  83. }
  84. .has-header, .bar-subheader {
  85. top: $bar-height;
  86. }
  87. .has-subheader {
  88. top: $bar-height + $bar-subheader-height;
  89. }
  90. }
  91. &.status-bar-hide {
  92. // Cordova doesn't adjust the body height correctly, this makes up for it
  93. margin-bottom: 20px;
  94. }
  95. }
  96. @media (orientation: landscape) {
  97. .item {
  98. padding: $item-padding calc(constant(safe-area-inset-right) + #{$item-padding});
  99. .badge {
  100. right: calc(constant(safe-area-inset-right) + 32px)
  101. }
  102. }
  103. .item-icon-left {
  104. padding-left: calc(constant(safe-area-inset-left) + 54px);
  105. .icon {
  106. left: calc(constant(safe-area-inset-left) + 11px);
  107. }
  108. }
  109. .item-icon-right {
  110. padding-right: calc(constant(safe-area-inset-right) + 54px);
  111. .icon {
  112. right: calc(constant(safe-area-inset-right) + 11px);
  113. }
  114. }
  115. .item-complex, a.item.item-complex, button.item.item-complex {
  116. padding: 0;
  117. .item-content {
  118. padding: $item-padding
  119. calc(constant(safe-area-inset-right) + #{(ceil( ($item-padding * 3) + ($item-padding / 3)) - 5)})
  120. $item-padding
  121. calc(constant(safe-area-inset-left) + #{$item-padding});
  122. }
  123. }
  124. .item-left-edit.visible.active {
  125. @include translate3d(calc(constant(safe-area-inset-left) + 8px), 0, 0);
  126. }
  127. .list-left-editing .item-left-editable .item-content,
  128. .item-left-editing.item-left-editable .item-content {
  129. @include translate3d(calc(constant(safe-area-inset-left) + 50px), 0, 0);
  130. }
  131. .item-right-edit{
  132. right: constant(safe-area-inset-right);
  133. right: env(safe-area-inset-right)
  134. }
  135. .platform-ios.platform-browser.platform-ipad {
  136. position: fixed; // required for iPad 7 Safari
  137. }
  138. }
  139. .platform-c:not(.enable-transitions) * {
  140. // disable transitions on grade-c devices (Android 2)
  141. -webkit-transition: none !important;
  142. transition: none !important;
  143. }