From 98dcb3ae16db61843810bdaac729596898cbdf2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 14 Apr 2020 12:16:09 +0200 Subject: [PATCH 1/2] MOBILE-3363 settings: Allow auto dark mode on iOS --- src/core/settings/pages/general/general.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/core/settings/pages/general/general.ts b/src/core/settings/pages/general/general.ts index 76b680088..2ddc61e0c 100644 --- a/src/core/settings/pages/general/general.ts +++ b/src/core/settings/pages/general/general.ts @@ -14,7 +14,6 @@ import { Component, ViewChild } from '@angular/core'; import { IonicPage, Segment } from 'ionic-angular'; -import { CoreAppProvider } from '@providers/app'; import { CoreConstants } from '@core/constants'; import { CoreConfigProvider } from '@providers/config'; import { CoreFileProvider } from '@providers/file'; @@ -49,10 +48,14 @@ export class CoreSettingsGeneralPage { selectedScheme: string; colorSchemeDisabled: boolean; - constructor(private appProvider: CoreAppProvider, private configProvider: CoreConfigProvider, fileProvider: CoreFileProvider, - private eventsProvider: CoreEventsProvider, private langProvider: CoreLangProvider, - private domUtils: CoreDomUtilsProvider, private pushNotificationsProvider: CorePushNotificationsProvider, - localNotificationsProvider: CoreLocalNotificationsProvider, private settingsHelper: CoreSettingsHelper) { + constructor(protected configProvider: CoreConfigProvider, + fileProvider: CoreFileProvider, + protected eventsProvider: CoreEventsProvider, + protected langProvider: CoreLangProvider, + protected domUtils: CoreDomUtilsProvider, + protected pushNotificationsProvider: CorePushNotificationsProvider, + localNotificationsProvider: CoreLocalNotificationsProvider, + protected settingsHelper: CoreSettingsHelper) { // Get the supported languages. const languages = CoreConfigConstants.languages; @@ -72,9 +75,8 @@ export class CoreSettingsGeneralPage { } else { let defaultColorScheme = 'light'; - // Auto is not working on iOS right now until we update Webkit. - if (!this.appProvider.isIOS() && (window.matchMedia('(prefers-color-scheme: dark)').matches || - window.matchMedia('(prefers-color-scheme: light)').matches)) { + if (window.matchMedia('(prefers-color-scheme: dark)').matches || + window.matchMedia('(prefers-color-scheme: light)').matches) { this.colorSchemes.push('auto'); defaultColorScheme = 'auto'; } From 1eb8a045af0539edb93fd1d84b4ba8c7f23406bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 14 Apr 2020 12:32:41 +0200 Subject: [PATCH 2/2] MOBILE-3363 styles: Style dark mode action sheet buttons --- src/app/app.scss | 3 ++- src/core/login/login.scss | 6 ++++++ src/theme/dark.scss | 1 + src/theme/variables.scss | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/app.scss b/src/app/app.scss index cc99bbfa8..a75d033d7 100644 --- a/src/app/app.scss +++ b/src/app/app.scss @@ -666,11 +666,12 @@ ion-app.app-root { overflow: auto; } - .action-sheet-wrapper { + ion-action-sheet .action-sheet-wrapper .action-sheet-container { .action-sheet-button.action-sheet-cancel { color: $core-action-sheet-cancel-color; @include darkmode() { color: $core-dark-action-sheet-cancel-color; + background-color: $black; } } .action-sheet-selected { diff --git a/src/core/login/login.scss b/src/core/login/login.scss index d0bc7225b..7dce8dd70 100644 --- a/src/core/login/login.scss +++ b/src/core/login/login.scss @@ -30,6 +30,12 @@ ion-app.app-root page-core-login-site { border-color: $core-dark-login-box-background-border; color: $core-dark-login-box-text-color; } + + .item { + @include darkmode() { + background: $core-dark-login-box-background-color; + } + } } .core-sitename, .core-siteurl { diff --git a/src/theme/dark.scss b/src/theme/dark.scss index 7e065f077..94ce2b6b1 100644 --- a/src/theme/dark.scss +++ b/src/theme/dark.scss @@ -23,6 +23,7 @@ ion-app.app-root { &.action-sheet-selected { color: $core-color; + background-color: $black; } &.activated { background-color: $black; diff --git a/src/theme/variables.scss b/src/theme/variables.scss index 15002db6f..aefe54083 100644 --- a/src/theme/variables.scss +++ b/src/theme/variables.scss @@ -90,7 +90,7 @@ $inverted-contrast: $primary !default; $primary-dark: lighten($primary, 10%) !default; $secondary-dark: mix($secondary, white, 20%) !default; -$danger-dark: mix($danger, white, 20%) !default; +$danger-dark: mix($danger, white, 80%) !default; $warning-dark: mix($warning, white, 20%) !default; $success-dark: mix($success, white, 20%) !default; $info-dark: mix($info, white, 20%) !default;