From e132a4804029db9d44f090a25eb8fb906a29090c Mon Sep 17 00:00:00 2001 From: Sergey Andrievskiy Date: Thu, 20 Sep 2018 16:22:30 +0300 Subject: [PATCH 01/15] feat(auth): remove bootstrap styles --- angular.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/angular.json b/angular.json index 74e542b05a..61ac2dec46 100644 --- a/angular.json +++ b/angular.json @@ -26,7 +26,6 @@ "src/favicon.ico" ], "styles": [ - "node_modules/bootstrap/dist/css/bootstrap.css", "node_modules/nebular-icons/scss/nebular-icons.scss", "src/styles.scss" ], @@ -78,7 +77,6 @@ "tsConfig": "src/tsconfig.spec.json", "scripts": [], "styles": [ - "node_modules/bootstrap/dist/css/bootstrap.css", "node_modules/nebular-icons/scss/nebular-icons.scss", "src/styles.scss" ], @@ -147,7 +145,6 @@ "src/favicon.ico" ], "styles": [ - "node_modules/bootstrap/dist/css/bootstrap.css", "node_modules/nebular-icons/scss/nebular-icons.scss", "src/styles.scss" ], @@ -199,7 +196,6 @@ "tsConfig": "src/tsconfig.spec.json", "scripts": [], "styles": [ - "node_modules/bootstrap/dist/css/bootstrap.css", "node_modules/nebular-icons/scss/nebular-icons.scss", "src/styles.scss" ], From 0a3d379047580ab82e1710fcd9a90b69b49efc85 Mon Sep 17 00:00:00 2001 From: Sergey Andrievskiy Date: Thu, 20 Sep 2018 16:24:44 +0300 Subject: [PATCH 02/15] feat(theme): add box-sizing reset --- src/framework/theme/styles/global/_normalize.scss | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/framework/theme/styles/global/_normalize.scss b/src/framework/theme/styles/global/_normalize.scss index 70ebb3e245..f27c0b612f 100644 --- a/src/framework/theme/styles/global/_normalize.scss +++ b/src/framework/theme/styles/global/_normalize.scss @@ -6,3 +6,15 @@ @import '~normalize.css/normalize.css'; +html { + box-sizing: border-box; +} +*, *::before, *::after { + box-sizing: inherit; +} + +html, body { + margin: 0; + padding: 0; +} + From 873e4208f1da934c1872947eeeb34ef7f08ebe14 Mon Sep 17 00:00:00 2001 From: Sergey Andrievskiy Date: Thu, 20 Sep 2018 16:27:09 +0300 Subject: [PATCH 03/15] refactor(auth): remove auth-block and move styles to auth component --- src/framework/auth/auth.module.ts | 3 - ....theme.scss => _auth.component.theme.scss} | 16 +- .../auth-block/auth-block.component.scss | 70 ----- .../auth-block/auth-block.component.ts | 11 - .../auth/components/auth.component.scss | 141 ++++++++-- .../auth/components/auth.component.ts | 8 +- src/framework/auth/components/index.ts | 1 - .../components/login/login.component.html | 177 ++++++------ .../auth/components/login/login.component.ts | 3 +- .../register/register.component.html | 259 +++++++++--------- .../request-password.component.html | 101 +++---- .../request-password.component.scss | 5 - .../reset-password.component.html | 152 +++++----- .../reset-password.component.scss | 5 - .../auth/styles/global/_components.scss | 4 +- 15 files changed, 485 insertions(+), 471 deletions(-) rename src/framework/auth/components/{auth-block/_auth-block.component.theme.scss => _auth.component.theme.scss} (74%) delete mode 100644 src/framework/auth/components/auth-block/auth-block.component.scss delete mode 100644 src/framework/auth/components/auth-block/auth-block.component.ts diff --git a/src/framework/auth/auth.module.ts b/src/framework/auth/auth.module.ts index 7a03de5d39..6b3a7e6009 100644 --- a/src/framework/auth/auth.module.ts +++ b/src/framework/auth/auth.module.ts @@ -45,7 +45,6 @@ import { import { NbAuthComponent } from './components/auth.component'; -import { NbAuthBlockComponent } from './components/auth-block/auth-block.component'; import { NbLoginComponent } from './components/login/login.component'; import { NbRegisterComponent } from './components/register/register.component'; import { NbLogoutComponent } from './components/logout/logout.component'; @@ -99,7 +98,6 @@ export function nbNoOpInterceptorFilter(req: HttpRequest): boolean { ], declarations: [ NbAuthComponent, - NbAuthBlockComponent, NbLoginComponent, NbRegisterComponent, NbRequestPasswordComponent, @@ -108,7 +106,6 @@ export function nbNoOpInterceptorFilter(req: HttpRequest): boolean { ], exports: [ NbAuthComponent, - NbAuthBlockComponent, NbLoginComponent, NbRegisterComponent, NbRequestPasswordComponent, diff --git a/src/framework/auth/components/auth-block/_auth-block.component.theme.scss b/src/framework/auth/components/_auth.component.theme.scss similarity index 74% rename from src/framework/auth/components/auth-block/_auth-block.component.theme.scss rename to src/framework/auth/components/_auth.component.theme.scss index 7b48d910ea..9173ef932a 100644 --- a/src/framework/auth/components/auth-block/_auth-block.component.theme.scss +++ b/src/framework/auth/components/_auth.component.theme.scss @@ -4,18 +4,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. */ -@mixin nb-auth-block-theme() { - nb-auth-block { - - .form-text a { +@mixin nb-auth-theme() { + nb-auth { + .text-link { color: nb-theme(color-fg); + font-weight: bold; } - .accept-group { - nb-checkbox .custom-control-description { - color: nb-theme(color-fg); - } + .error-message { + color: nb-theme(color-danger); + } + .accept-group { a { color: nb-theme(accept-group-link-color); } diff --git a/src/framework/auth/components/auth-block/auth-block.component.scss b/src/framework/auth/components/auth-block/auth-block.component.scss deleted file mode 100644 index 0b86268064..0000000000 --- a/src/framework/auth/components/auth-block/auth-block.component.scss +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @license - * Copyright Akveo. All Rights Reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - */ - -:host /deep/ { - // TODO rewrite when develop responsive - @media (max-width: 550px) { - .accept-group { - font-size: 12px; - padding: 0; - } - } - - form { - width: 100%; - } - - .alert { - text-align: center; - } - - .title { - margin-bottom: 0.75rem; - text-align: center; - } - - .sub-title { - margin-bottom: 2rem; - text-align: center; - } - - .checkbox { - display: flex; - justify-content: space-between; - margin-bottom: 10px; - font-weight: normal; - } - - .form-group.accept-group { - display: flex; - justify-content: space-between; - margin: 2rem 0; - - .forgot-password { - line-height: 2; - } - } - - .links { - text-align: center; - margin-top: 1.75rem; - - .socials { - margin: 1.5rem 0 2.5rem; - } - - .socials a { - margin: 0 1rem; - text-decoration: none; - font-size: 1rem; - vertical-align: middle; - - &.with-icon { - font-size: 2rem; - } - } - } -} diff --git a/src/framework/auth/components/auth-block/auth-block.component.ts b/src/framework/auth/components/auth-block/auth-block.component.ts deleted file mode 100644 index 95e281f3bc..0000000000 --- a/src/framework/auth/components/auth-block/auth-block.component.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'nb-auth-block', - styleUrls: ['./auth-block.component.scss'], - template: ` - - `, -}) -export class NbAuthBlockComponent { -} diff --git a/src/framework/auth/components/auth.component.scss b/src/framework/auth/components/auth.component.scss index 836fec7542..2abc24a4c6 100644 --- a/src/framework/auth/components/auth.component.scss +++ b/src/framework/auth/components/auth.component.scss @@ -1,44 +1,139 @@ -:host /deep/ { - $auth-layout-padding: 2.5rem; +@import '../../theme/styles/global/breakpoints'; - nb-layout .layout .layout-container .content .columns nb-layout-column { - padding: $auth-layout-padding; - } +:host { + $auth-layout-padding: 2.5rem; nb-card { + margin: 0; height: calc(100vh - 2 * #{$auth-layout-padding}); } - nb-card-header { - a { - text-decoration: none; - i { - font-size: 2rem; - font-weight: bold; - } + .navigation .link { + text-decoration: none; + + .icon { + font-size: 2rem; + font-weight: bold; } } - nb-card { - margin: 0; - } - .flex-centered { - margin: auto; - } nb-card-body { display: flex; + width: 100%; } - // TODO rewrite when develop responsive - @media (max-width: 550px) { - /deep/ nb-layout .layout .layout-container .content .columns nb-layout-column { - padding: 0; - } + .auth-component-container { + flex: 1 0 auto; + margin: auto; + max-width: 35rem; + } + @include media-breakpoint-down(sm) { nb-card { border-radius: 0; height: 100vh; } } + /deep/ { + nb-layout .layout .layout-container .content .columns nb-layout-column { + padding: $auth-layout-padding; + + @include media-breakpoint-down(sm) { + padding: 0; + } + } + + form { + width: 100%; + } + + .label { + display: block; + margin-bottom: 0.5rem; + } + + .error-message { + margin-top: 0.5rem; + } + + .alert { + text-align: center; + } + + .title { + margin-top: 0; + margin-bottom: 0.75rem; + text-align: center; + } + + .sub-title { + margin-bottom: 2rem; + text-align: center; + } + + .checkbox { + display: flex; + justify-content: space-between; + margin-bottom: 10px; + font-weight: normal; + } + + .form-control-group { + margin-bottom: 2rem; + } + + .form-control-group.accept-group { + display: flex; + justify-content: space-between; + margin: 2rem 0; + + .forgot-password { + line-height: 2; + } + } + + .links { + text-align: center; + margin-top: 1.75rem; + + .socials { + margin-top: 1.5rem; + } + + .socials a { + margin: 0 1rem; + text-decoration: none; + font-size: 1rem; + vertical-align: middle; + + &.with-icon { + font-size: 2rem; + } + } + } + + .another-action { + margin-top: 2rem; + text-align: center; + } + + .sign-in-or-up { + margin-top: 2rem; + display: flex; + justify-content: space-between; + } + + nb-alert { + .alert-title, + .alert-message { + margin: 0 0 0.5rem; + } + .alert-message-list { + list-style-type: none; + padding: 0; + margin: 0; + } + } + } } diff --git a/src/framework/auth/components/auth.component.ts b/src/framework/auth/components/auth.component.ts index 1ba9740970..f48b293e59 100644 --- a/src/framework/auth/components/auth.component.ts +++ b/src/framework/auth/components/auth.component.ts @@ -17,12 +17,14 @@ import { takeWhile } from 'rxjs/operators'; - + -
+
-
+
diff --git a/src/framework/auth/components/index.ts b/src/framework/auth/components/index.ts index 45b2149af7..72c4576db3 100644 --- a/src/framework/auth/components/index.ts +++ b/src/framework/auth/components/index.ts @@ -1,5 +1,4 @@ export * from './auth.component'; -export * from './auth-block/auth-block.component'; export * from './login/login.component'; export * from './logout/logout.component'; export * from './register/register.component'; diff --git a/src/framework/auth/components/login/login.component.html b/src/framework/auth/components/login/login.component.html index ef1d17baf6..92d717a720 100644 --- a/src/framework/auth/components/login/login.component.html +++ b/src/framework/auth/components/login/login.component.html @@ -1,105 +1,106 @@ - -

Sign In

- Hello! Sign in with your username or email +

Sign In

+

Hello! Sign in with your username or email.

-
+ +

Oh snap!

+
    +
  • {{ error }}
  • +
+
- -
Oh snap!
-
{{ error }}
-
+ +

Hooray!

+
    +
  • {{ message }}
  • +
+
- -
Hooray!
-
{{ message }}
-
+ -
- - - +
+ + + +

Email is required! - - +

+

Email should be the real one! - -

+

+ +
-
- - - +
+ + + +

Password is required! - - +

+

Password should contains from {{ getConfigValue('forms.validation.password.minLength') }} to {{ getConfigValue('forms.validation.password.maxLength') }} characters - -

- -
- Remember me - Forgot Password? -
- - - +

+ +
-