From 5fdfce0bff12a9dd594c702add7a26848d749d2b Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 30 Jan 2018 20:03:41 -0500 Subject: [PATCH] environment styling --- src/app/services/services.module.ts | 14 +++++++++++--- src/index.html | 2 +- src/scss/base.scss | 4 ---- src/scss/environment.scss | 7 +++++++ 4 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 src/scss/environment.scss diff --git a/src/app/services/services.module.ts b/src/app/services/services.module.ts index defea6760e..7738a8a1d1 100644 --- a/src/app/services/services.module.ts +++ b/src/app/services/services.module.ts @@ -98,8 +98,13 @@ environmentService.setUrlsFromStorage().then(() => { return syncService.fullSync(true); }); -function initFactory(i18n: I18nService): Function { - return () => i18n.init(); +function initFactory(i18n: I18nService, platformUtilsService: DesktopPlatformUtilsService): Function { + return async () => { + await i18n.init(); + const htmlEl = window.document.documentElement; + htmlEl.classList.add('os_' + platformUtilsService.getDeviceString()); + htmlEl.classList.add('locale_' + i18n.translationLocale); + }; } @NgModule({ @@ -121,7 +126,10 @@ function initFactory(i18n: I18nService): Function { { provide: APP_INITIALIZER, useFactory: initFactory, - deps: [I18nServiceAbstraction], + deps: [ + I18nServiceAbstraction, + PlatformUtilsServiceAbstraction, + ], multi: true, }, ], diff --git a/src/index.html b/src/index.html index c67cc8fa9f..d786e532d5 100644 --- a/src/index.html +++ b/src/index.html @@ -1,5 +1,5 @@  - + diff --git a/src/scss/base.scss b/src/scss/base.scss index 8ceb536165..b5a162b273 100644 --- a/src/scss/base.scss +++ b/src/scss/base.scss @@ -16,10 +16,6 @@ html, body { line-height: 1.42857143; } -body { - border-top: 1px solid $border-color-dark; -} - h1, h2, h3, h4, h5, h6 { font-family: $font-family-sans-serif; color: $text-color; diff --git a/src/scss/environment.scss b/src/scss/environment.scss new file mode 100644 index 0000000000..95ce9ffa04 --- /dev/null +++ b/src/scss/environment.scss @@ -0,0 +1,7 @@ +@import "variables.scss"; + +html.os_windows { + body { + border-top: 1px solid $border-color-dark; + } +}