Skip to content

Commit 112d4f5

Browse files
authored
feat(): initial iphoneX support
* feat(cordova): add ios11 safeAreaInsets support * feat(cordova): ios11 padding mixin * chore(dependencies): go to angular 4.1.3 * chore(build): temporarily disable git pull and status from master as part of build * fix(sass): add a mixin for the safe-area-padding * style(sass): fix sass lint errors * style(): tabs, footer, content changes * fix(): lint * style(sass): fix sass linter error * refactor(footer): use safe area for all modes * fix(tabs): increase font-weight of tabs for iOS 11 * style(): fix content padding and sizing * style(sass): fix linter and remove unused vars * style(): actionsheet, toast, header updates * fix(): sass lint * chore(): backout release changes * chore(): update to lastest master
1 parent f42e81b commit 112d4f5

File tree

13 files changed

+199
-21
lines changed

13 files changed

+199
-21
lines changed

scripts/gulp/tasks/release.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ task('release.pullLatest', (done: Function) => {
277277
done();
278278
}
279279
});
280+
done();
280281
});
281282

282283
task('release.prepareChangelog', () => {

src/components/action-sheet/action-sheet.ios.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ $action-sheet-ios-button-cancel-font-weight: 600 !default;
8989
@include text-align($action-sheet-ios-text-align);
9090
}
9191

92+
.action-sheet-ios .action-sheet-wrapper {
93+
@include margin(auto, auto, constant(safe-area-inset-bottom), auto);
94+
}
95+
9296
.action-sheet-ios .action-sheet-container {
9397
@include deprecated-variable(padding, $action-sheet-ios-padding) {
9498
@include padding($action-sheet-ios-padding-top, $action-sheet-ios-padding-end, $action-sheet-ios-padding-bottom, $action-sheet-ios-padding-start);

src/components/content/content.scss

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,40 +91,66 @@ ion-app [no-padding] .scroll-content {
9191
}
9292

9393
@mixin content-padding($mode, $content-padding) {
94-
ion-app.#{$mode} [padding],
95-
ion-app.#{$mode} [padding] .scroll-content {
94+
ion-app.#{$mode} [padding] {
9695
@include padding($content-padding);
9796
}
9897

99-
ion-app.#{$mode} [padding-top],
100-
ion-app.#{$mode} [padding-top] .scroll-content {
98+
ion-app.#{$mode} [padding-top] {
10199
@include padding($content-padding, null, null, null);
102100
}
103101

104-
ion-app.#{$mode} [padding-left],
105-
ion-app.#{$mode} [padding-left] .scroll-content {
102+
ion-app.#{$mode} [padding-left] {
106103
@include padding-horizontal($content-padding, null);
107104
}
108105

109-
ion-app.#{$mode} [padding-right],
110-
ion-app.#{$mode} [padding-right] .scroll-content {
106+
ion-app.#{$mode} [padding-right] {
111107
@include padding-horizontal(null, $content-padding);
112108
}
113109

114-
ion-app.#{$mode} [padding-bottom],
115-
ion-app.#{$mode} [padding-bottom] .scroll-content {
110+
ion-app.#{$mode} [padding-bottom] {
116111
@include padding(null, null, $content-padding, null);
117112
}
118113

119-
ion-app.#{$mode} [padding-vertical],
120-
ion-app.#{$mode} [padding-vertical] .scroll-content {
114+
ion-app.#{$mode} [padding-vertical] {
121115
@include padding($content-padding, null, $content-padding, null);
122116
}
123117

124-
ion-app.#{$mode} [padding-horizontal],
125-
ion-app.#{$mode} [padding-horizontal] .scroll-content {
118+
ion-app.#{$mode} [padding-horizontal] {
126119
@include padding-horizontal($content-padding);
127120
}
121+
122+
// Scroll content should use safe-area-padding
123+
ion-app.#{$mode} [padding] .scroll-content {
124+
@include safe-area-padding($content-padding);
125+
}
126+
127+
ion-app.#{$mode} .scroll-content {
128+
@include safe-area-no-padding($content-padding);
129+
}
130+
131+
ion-app.#{$mode} [padding-top] .scroll-content {
132+
@include safe-area-padding($content-padding, null, null, null);
133+
}
134+
135+
ion-app.#{$mode} [padding-left] .scroll-content {
136+
@include safe-area-padding-horizontal($content-padding, null);
137+
}
138+
139+
ion-app.#{$mode} [padding-right] .scroll-content {
140+
@include safe-area-padding-horizontal(null, $content-padding);
141+
}
142+
143+
ion-app.#{$mode} [padding-bottom] .scroll-content {
144+
@include safe-area-padding(null, null, $content-padding, null);
145+
}
146+
147+
ion-app.#{$mode} [padding-vertical] .scroll-content {
148+
@include safe-area-padding($content-padding, null, $content-padding, null);
149+
}
150+
151+
ion-app.#{$mode} [padding-horizontal] .scroll-content {
152+
@include safe-area-padding-horizontal($content-padding);
153+
}
128154
}
129155

130156

src/components/content/content.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, NgZone, OnDestroy, Optional, Output, Renderer, ViewChild, ViewEncapsulation } from '@angular/core';
1+
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostListener, Input, NgZone, OnDestroy, Optional, Output, Renderer, ViewChild, ViewEncapsulation } from '@angular/core';
22

33
import { App } from '../app/app';
44
import { Config } from '../../config/config';
@@ -670,6 +670,7 @@ export class Content extends Ion implements OnDestroy, AfterViewInit, IContent {
670670
* Tell the content to recalculate its dimensions. This should be called
671671
* after dynamically adding/removing headers, footers, or tabs.
672672
*/
673+
@HostListener('window:resize')
673674
resize() {
674675
this._dom.read(this._readDimensions.bind(this));
675676
this._dom.write(this._writeDimensions.bind(this));

src/components/item/item.ios.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ $item-ios-sliding-content-background: $list-ios-background-color !default;
139139

140140
.item-ios [item-right], // deprecated
141141
.item-ios [item-end] {
142-
@include margin($item-ios-padding-media-top, ($item-ios-padding-start / 2), $item-ios-padding-media-bottom, ($item-ios-padding-end / 2));
142+
@include margin($item-ios-padding-media-top, null, $item-ios-padding-media-bottom, ($item-ios-padding-end / 2));
143+
144+
@include safe-area-padding-horizontal(null, ($item-ios-padding-start / 4));
143145
}
144146

145147
.item-ios ion-icon[item-left], // deprecated

src/components/picker/picker.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ ion-picker-cmp {
5151
}
5252

5353
.picker-columns {
54+
@include margin(null, null, constant(safe-area-inset-bottom), null);
5455
position: relative;
5556
display: flex;
5657

src/components/tabs/tabs.ios.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ $tabs-ios-tab-icon-color-active: $tabs-ios-tab-color-active !default;
4242
/// @prop - Font size of the tab button text
4343
$tabs-ios-tab-font-size: 10px !default;
4444

45+
/// @prop - Font weight of the tab button text
46+
$tabs-ios-tab-font-weight: 500 !default;
47+
4548
/// @prop - Size of the tab button icon
4649
$tabs-ios-tab-icon-size: 30px !default;
4750

@@ -63,6 +66,7 @@ $tabs-ios-tab-icon-size: 30px !default;
6366
min-height: $tabs-ios-tab-min-height;
6467

6568
font-size: $tabs-ios-tab-font-size;
69+
font-weight: $tabs-ios-tab-font-weight;
6670
color: $tabs-ios-tab-text-color;
6771

6872
@include deprecated-variable(padding, $tabs-ios-tab-padding) {

src/components/toast/toast.ios.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@ $toast-ios-title-padding-start: $toast-ios-title-padding-end !
4848

4949
.toast-ios .toast-wrapper.toast-top {
5050
@include transform(translate3d(0, -100%, 0));
51+
@include margin(constant(safe-area-inset-top), auto, auto, auto);
5152

5253
top: 0;
5354
}
5455

5556
.toast-ios .toast-wrapper.toast-bottom {
5657
@include transform(translate3d(0, 100%, 0));
5758

59+
@include margin(auto, auto, constant(safe-area-inset-bottom), auto);
5860
bottom: 0;
5961
}
6062

src/platform/cordova.ios.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ $cordova-ios-statusbar-padding-modal-max-width: $cordova-statusbar-paddi
1111

1212
// Cordova mixins are in the main cordova file
1313
.ios {
14-
@include statusbar-padding($toolbar-ios-height, $toolbar-ios-padding, $content-ios-padding, $cordova-ios-statusbar-padding, $cordova-ios-statusbar-padding-modal-max-width, true);
15-
}
14+
@include statusbar-padding($toolbar-ios-height, $toolbar-ios-padding, $content-ios-padding, $cordova-ios-statusbar-padding, $cordova-ios-statusbar-padding-modal-max-width, true);
15+
16+
@include footer-safe-area($toolbar-ios-height, $toolbar-ios-padding);
17+
}

src/platform/cordova.md.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ $cordova-md-statusbar-padding-modal-max-width: $cordova-statusbar-paddin
1212
// Cordova mixins are in the main cordova file
1313
.md {
1414
@include statusbar-padding($toolbar-md-height, $toolbar-md-padding, $content-md-padding, $cordova-md-statusbar-padding, $cordova-md-statusbar-padding-modal-max-width);
15+
16+
@include footer-safe-area($toolbar-md-height, $toolbar-md-padding);
1517
}
1618

0 commit comments

Comments
 (0)