Skip to content

Commit

Permalink
fix(app): fix statusbarPadding
Browse files Browse the repository at this point in the history
fixes #15073
  • Loading branch information
manucorporat committed Aug 7, 2018
1 parent a77ee2a commit 2c925b7
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 33 deletions.
5 changes: 0 additions & 5 deletions core/src/components/app/app.ios.scss

This file was deleted.

6 changes: 0 additions & 6 deletions core/src/components/app/app.md.scss

This file was deleted.

34 changes: 23 additions & 11 deletions core/src/components/app/app.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
@import "../../themes/ionic.globals";
@import "../../themes/ionic.mixins";

ion-app.is-device {
user-select: none;
}

ion-app.statusbar-padding {
--ion-statusbar-padding: 20px;
}

@supports (padding-top: constant(safe-area-inset-top)) {
ion-app.statusbar-padding {
--ion-statusbar-padding: constant(safe-area-inset-top);
}
}

@supports (padding-top: env(safe-area-inset-top)) {
ion-app.statusbar-padding {
--ion-statusbar-padding: env(safe-area-inset-top);
}
}

// Page Container Structure
// --------------------------------------------------

Expand Down Expand Up @@ -31,16 +51,6 @@ ion-app,
opacity: 0;
}

.ion-page-hidden {
/* stylelint-disable-next-line declaration-no-important */
display: none !important;
}

ion-app.is-device {
user-select: none;
}


// Misc
// --------------------------------------------------

Expand All @@ -55,6 +65,8 @@ ion-alert-controller,
ion-loading-controller,
ion-modal-controller,
ion-picker-controller,
ion-toast-controller {
ion-toast-controller,
.ion-page-hidden {
/* stylelint-disable-next-line declaration-no-important */
display: none;
}
12 changes: 2 additions & 10 deletions core/src/components/app/app.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
import { Component, Element, Prop, QueueApi } from '@stencil/core';

import { Config, Mode } from '../../interface';
import { Config } from '../../interface';
import { isDevice, isHybrid, isStandaloneMode, needInputShims } from '../../utils/platform';
import { createThemedClasses } from '../../utils/theme';

@Component({
tag: 'ion-app',
styleUrls: {
ios: 'app.ios.scss',
md: 'app.md.scss'
}
styleUrl: 'app.scss'
})
export class App {

private isDevice = false;

mode!: Mode;

@Element() el!: HTMLElement;

@Prop({ context: 'window' }) win!: Window;
Expand All @@ -40,8 +34,6 @@ export class App {

return {
class: {
...createThemedClasses(this.mode, 'app'),

'is-device': this.isDevice,
'is-hydrid': hybrid,
'is-standalone': isStandalone,
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/header/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ ion-header ion-toolbar:first-child {
@supports (padding-top: env(safe-area-inset-top)) {
ion-header ion-toolbar:first-child {
/* stylelint-disable-next-line length-zero-no-unit */
padding-top: calc(env(safe-area-inset-top) + var(--ion-statusbar-padding, 0px));
padding-top: var(--ion-statusbar-padding, 0px);
}
}

0 comments on commit 2c925b7

Please sign in to comment.