Skip to content

Commit

Permalink
Merge pull request #14 from Gamboster/rastajpa/feat/dark-mode
Browse files Browse the repository at this point in the history
Smooth transitions - navigation bar
  • Loading branch information
rastajpa committed Mar 2, 2020
2 parents 9aa2de8 + ba6e523 commit 533b8a8
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -145,6 +145,7 @@
"cordova-plugin-globalization": "1.0.9",
"cordova-plugin-inappbrowser": "3.1.0",
"cordova-plugin-ionic-keyboard": "2.1.3",
"cordova-plugin-navigationbar-color": "0.0.9",
"cordova-plugin-qrscanner": "3.0.1",
"cordova-plugin-screen-orientation": "3.0.2",
"cordova-plugin-spinner-dialog": "1.3.1",
Expand Down Expand Up @@ -265,4 +266,4 @@
"prettier": {
"singleQuote": true
}
}
}
1 change: 0 additions & 1 deletion src/providers/app/app.ts
Expand Up @@ -84,7 +84,6 @@ export class AppProvider {
this.persistence.load();
await this.config.load();
await this.persistence.getAppTheme().then(value => {
if (!value) this.persistence.setAppTheme('light-theme');
this.appTheme = new BehaviorSubject(value);
});
this.language.load();
Expand Down
15 changes: 15 additions & 0 deletions src/theme/dark.scss
Expand Up @@ -12,6 +12,10 @@
// Home Messages
$message-background-dark-theme: #121212;

@mixin transition {
transition: background-color, color, 250ms cubic-bezier(0, 0, 0.3, 0.3) !important;
}

// General -----
ion-content {
background-color: $background-color-dark-theme;
Expand All @@ -31,19 +35,23 @@
.toolbar-background-md {
background: $background-color-dark-theme;
color: $text-color-dark-theme;
@include transition();
}

.toolbar-title {
color: $text-color-dark-theme;
@include transition();
}

.header .toolbar-background {
background-color: $background-color-dark-theme;
@include transition();
}
.tabs-md,
.tabs-ios {
.tabbar {
background: $background-color-dark-theme;
@include transition();
}
}
.swiper-pagination-bullet-active {
Expand All @@ -53,6 +61,11 @@
background-color: #4f4f4e;
}

button.item.activated,
.item-md.activated {
background-color: #4f4f4e;
}

ion-searchbar {
.searchbar-input-container {
input.searchbar-input {
Expand All @@ -64,6 +77,7 @@
}
}
}

// Lists -----
.bp-list {
.item {
Expand All @@ -72,6 +86,7 @@
border: 0;
background-color: $background-color-dark-theme;
color: $text-color-dark-theme;
@include transition();
}
}
.main-label {
Expand Down
37 changes: 35 additions & 2 deletions src/theme/light.scss
@@ -1,2 +1,35 @@
// .light-theme {
// }
.light-theme {
// Uses default values. This is just to make a smooth transition between themes
@mixin transition {
transition: background-color, color, 250ms cubic-bezier(0, 0, 0.3, 0.3) !important;
}

// General -----
.toolbar-background-md {
@include transition();
}

.toolbar-title {
@include transition();
}

.header .toolbar-background {
@include transition();
}
.tabs-md,
.tabs-ios {
.tabbar {
@include transition();
}
}

// Lists -----
.bp-list {
.item {
&.item-ios,
&.item-md {
@include transition();
}
}
}
}

0 comments on commit 533b8a8

Please sign in to comment.