|
| 1 | +@import "../globals.core"; |
| 2 | + |
| 3 | +// Cordova Status Bar Padding iOS Platform |
| 4 | +// -------------------------------------------------------------------------------- |
| 5 | + |
| 6 | +// The height of the ios statusbar |
| 7 | +$cordova-ios-statusbar-padding: 20px !default; |
| 8 | + |
| 9 | +// The breakpoint when a modal becomes inset |
| 10 | +$cordova-statusbar-padding-modal-max-width: 767px !default; |
| 11 | + |
| 12 | + |
| 13 | +// The first-child should get modified padding-top for the status bar |
| 14 | +// -------------------------------------------------------------------------------- |
| 15 | + |
| 16 | +@mixin toolbar-statusbar-padding($toolbar-height, $content-padding) { |
| 17 | + |
| 18 | + > .toolbar.statusbar-padding:first-child { |
| 19 | + padding-top: $cordova-ios-statusbar-padding; |
| 20 | + height: calc(#{$toolbar-height} + #{$cordova-ios-statusbar-padding}); |
| 21 | + min-height: calc(#{$toolbar-height} + #{$cordova-ios-statusbar-padding}); |
| 22 | + } |
| 23 | + |
| 24 | + > ion-content.statusbar-padding:first-child scroll-content { |
| 25 | + padding-top: $cordova-ios-statusbar-padding; |
| 26 | + } |
| 27 | + |
| 28 | + > ion-content.statusbar-padding:first-child[padding] scroll-content, |
| 29 | + > ion-content.statusbar-padding:first-child[padding-top] scroll-content { |
| 30 | + padding-top: calc(#{$content-padding} + #{$cordova-ios-statusbar-padding}); |
| 31 | + } |
| 32 | + |
| 33 | +} |
| 34 | + |
| 35 | +// The navbar section should get modified height and padding-top for the status bar |
| 36 | +// -------------------------------------------------------------------------------- |
| 37 | + |
| 38 | +@mixin navbar-section-statusbar-padding($toolbar-height) { |
| 39 | + |
| 40 | + ion-navbar-section.statusbar-padding { |
| 41 | + height: calc(#{$toolbar-height} + #{$cordova-ios-statusbar-padding}); |
| 42 | + min-height: calc(#{$toolbar-height} + #{$cordova-ios-statusbar-padding}); |
| 43 | + } |
| 44 | + |
| 45 | + ion-navbar-section.statusbar-padding > .toolbar { |
| 46 | + padding-top: $cordova-ios-statusbar-padding; |
| 47 | + |
| 48 | + height: calc(#{$toolbar-height} + #{$cordova-ios-statusbar-padding}); |
| 49 | + min-height: calc(#{$toolbar-height} + #{$cordova-ios-statusbar-padding}); |
| 50 | + } |
| 51 | + |
| 52 | +} |
| 53 | + |
| 54 | + |
| 55 | +// iOS is the only mode that uses these mixins and they should be removed with #5036 |
| 56 | +// -------------------------------------------------------------------------------- |
| 57 | + |
| 58 | +@mixin toolbar-title-statusbar-padding($toolbar-height, $content-padding) { |
| 59 | + |
| 60 | + > .toolbar.statusbar-padding:first-child ion-segment, |
| 61 | + > .toolbar.statusbar-padding:first-child ion-title { |
| 62 | + padding-top: $cordova-ios-statusbar-padding; |
| 63 | + height: calc(#{$toolbar-height} + #{$cordova-ios-statusbar-padding}); |
| 64 | + min-height: calc(#{$toolbar-height} + #{$cordova-ios-statusbar-padding}); |
| 65 | + } |
| 66 | + |
| 67 | +} |
| 68 | + |
| 69 | +@mixin navbar-section-title-statusbar-padding($toolbar-height) { |
| 70 | + |
| 71 | + ion-navbar-section.statusbar-padding > .toolbar ion-segment, |
| 72 | + ion-navbar-section.statusbar-padding > .toolbar ion-title { |
| 73 | + padding-top: $cordova-ios-statusbar-padding; |
| 74 | + |
| 75 | + height: calc(#{$toolbar-height} + #{$cordova-ios-statusbar-padding}); |
| 76 | + min-height: calc(#{$toolbar-height} + #{$cordova-ios-statusbar-padding}); |
| 77 | + } |
| 78 | + |
| 79 | +} |
0 commit comments