1 | @import "../themes/ionic.globals";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | $cordova-statusbar-padding-modal-max-width: 767px !default;
|
8 |
|
9 |
|
10 | @mixin statusbar-padding($toolbar-height, $toolbar-padding, $content-padding, $cordova-statusbar-padding, $modal-max-width, $style-title: false) {
|
11 |
|
12 | ion-nav > .ion-page,
|
13 | ion-nav > .ion-page > ion-header,
|
14 | ion-tab > .ion-page,
|
15 | ion-tab > .ion-page > ion-header,
|
16 | ion-tabs > .ion-page.tab-subpage > ion-header,
|
17 | ion-menu > .menu-inner,
|
18 | ion-menu > .menu-inner > ion-header {
|
19 |
|
20 | @include toolbar-statusbar-padding($toolbar-height, $toolbar-padding, $content-padding, $cordova-statusbar-padding);
|
21 |
|
22 |
|
23 | @if ($style-title) {
|
24 | @include toolbar-title-statusbar-padding($toolbar-height, $toolbar-padding, $content-padding, $cordova-statusbar-padding);
|
25 | }
|
26 | }
|
27 |
|
28 | @media only screen and (max-width: $modal-max-width) {
|
29 | .modal-wrapper > .ion-page > ion-header {
|
30 | @include toolbar-statusbar-padding($toolbar-height, $toolbar-padding, $content-padding, $cordova-statusbar-padding);
|
31 |
|
32 |
|
33 | @if ($style-title) {
|
34 | @include toolbar-title-statusbar-padding($toolbar-height, $toolbar-padding, $content-padding, $cordova-statusbar-padding);
|
35 | }
|
36 | }
|
37 | }
|
38 |
|
39 | }
|
40 |
|
41 |
|
42 |
|
43 |
|
44 | @mixin toolbar-statusbar-padding($toolbar-height, $toolbar-padding, $content-padding, $cordova-statusbar-padding) {
|
45 |
|
46 |
|
47 | > .toolbar.statusbar-padding:first-child {
|
48 | @include padding(calc(#{$cordova-statusbar-padding} + #{$toolbar-padding}), null, null, null);
|
49 | @include padding(calc(constant(safe-area-inset-top) + #{$toolbar-padding}), null, null, null);
|
50 | @include padding(calc(env(safe-area-inset-top) + #{$toolbar-padding}), null, null, null);
|
51 |
|
52 | min-height: calc(#{$toolbar-height} + #{$cordova-statusbar-padding});
|
53 | min-height: calc(#{$toolbar-height} + constant(safe-area-inset-top));
|
54 | min-height: calc(#{$toolbar-height} + env(safe-area-inset-top));
|
55 | }
|
56 |
|
57 | > ion-content.statusbar-padding:first-child .scroll-content {
|
58 | @include padding($cordova-statusbar-padding, null, null, null);
|
59 | @include padding(constant(safe-area-inset-top), null, null, null);
|
60 | @include padding(env(safe-area-inset-top), null, null, null);
|
61 | }
|
62 |
|
63 | > ion-content.statusbar-padding:first-child[padding] .scroll-content,
|
64 | > ion-content.statusbar-padding:first-child[padding-top] .scroll-content {
|
65 | @include padding(calc(#{$content-padding} + #{$cordova-statusbar-padding}), null, null, null);
|
66 | @include padding(constant(safe-area-inset-top), null, null, null);
|
67 | @include padding(env(safe-area-inset-top), null, null, null);
|
68 | }
|
69 |
|
70 | }
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 | @mixin toolbar-title-statusbar-padding($toolbar-height, $toolbar-padding, $content-padding, $cordova-statusbar-padding) {
|
77 |
|
78 | > .toolbar.statusbar-padding:first-child ion-segment,
|
79 | > .toolbar.statusbar-padding:first-child ion-title {
|
80 | @include padding($cordova-statusbar-padding, null, null, null);
|
81 | @include padding(constant(safe-area-inset-top), null, null, null);
|
82 | @include padding(env(safe-area-inset-top), null, null, null);
|
83 |
|
84 | height: calc(#{$toolbar-height} + #{$cordova-statusbar-padding});
|
85 | height: calc(#{$toolbar-height} + constant(safe-area-inset-top));
|
86 | height: calc(#{$toolbar-height} + env(safe-area-inset-top));
|
87 |
|
88 | min-height: calc(#{$toolbar-height} + #{$cordova-statusbar-padding});
|
89 | min-height: calc(#{$toolbar-height} + constant(safe-area-inset-top));
|
90 | min-height: calc(#{$toolbar-height} + env(safe-area-inset-top));
|
91 | }
|
92 |
|
93 | }
|
94 |
|
95 |
|
96 | @mixin footer-safe-area($toolbar-height, $toolbar-padding) {
|
97 | .tabs:not(.tabs-ios[tabsPlacement=top]) .tabbar {
|
98 | @include padding(null, null, constant(safe-area-inset-bottom), null);
|
99 | @include padding(null, null, env(safe-area-inset-bottom), null);
|
100 | }
|
101 |
|
102 | ion-footer .toolbar:last-child {
|
103 | @include padding(null, null, calc(constant(safe-area-inset-bottom) + #{$toolbar-padding}), null);
|
104 | @include padding(null, null, calc(env(safe-area-inset-bottom) + #{$toolbar-padding}), null);
|
105 | min-height: calc(#{$toolbar-height} + constant(safe-area-inset-bottom));
|
106 | min-height: calc(#{$toolbar-height} + env(safe-area-inset-bottom));
|
107 | }
|
108 |
|
109 | .tabs:not(.tabs-ios[tabsPlacement='top']) ion-footer .toolbar:last-child {
|
110 | @include padding(null, null, $toolbar-padding, null);
|
111 | min-height: $toolbar-height;
|
112 | }
|
113 | }
|