refactor(theme): theme refactor, buttons, toaster, preloader

This commit is contained in:
Dmitry Nehaychik 2017-06-02 12:43:23 +03:00
parent d5f69647aa
commit 59ef144716
77 changed files with 1324 additions and 954 deletions

View file

@ -1,4 +0,0 @@
@mixin base-footer-theme($theme-name) {
/deep/ base-footer {
}
}

View file

@ -1,4 +0,0 @@
@mixin base-header-theme($theme-name) {
/deep/ header {
}
}

View file

@ -1,7 +0,0 @@
@mixin search-input-theme($theme-name) {
/deep/ search-input {
input {
background: transparent;
}
}
}

View file

@ -24,4 +24,10 @@
margin: 0;
}
}
/deep/ search-input {
input {
background: transparent;
}
}
}

View file

@ -1,11 +0,0 @@
@import '../components/header/header.component.theme';
@import '../components/search-input/search-input.component.theme';
@import '../components/footer/footer.component.theme';
// TODO: probably move this file into the components folder?
@mixin custom-components-theme($theme-name) {
@include base-header-theme($theme-name);
@include base-footer-theme($theme-name);
@include search-input-theme($theme-name);
}

View file

@ -0,0 +1,114 @@
@mixin ngx-buttons-theme($theme-name) {
$btn-component-size: 50px;
$btn-component-bd-radius: 12px;
@mixin btn-component($bevel-bd, $glow) {
.btn-bevel-border {
box-shadow: 0 3px 0 0 $bevel-bd;
}
.btn-shadow {
box-shadow: 0 4px 10px 0 $nga-color-gradient-shadow;
}
.btn-glow {
box-shadow: 0 2px 12px 0 $glow;
}
}
.btn-hero-container {
padding-right: 0;
.container-title {
margin-bottom: 14px;
}
.container-btn {
margin-bottom: 24px;
}
.btn-components-container {
.btn-component {
display: flex;
.btn-gradient,
.btn-border,
.btn-bevel-border,
.btn-shadow,
.btn-glow {
width: $btn-component-size;
height: $btn-component-size;
border-radius: $btn-component-bd-radius;
margin-bottom: 16px;
}
.btn-component-details {
display: flex;
flex-direction: column;
justify-content: center;
margin-left: 17px;
height: $btn-component-size;
}
.btn-component-header {
color: white;
}
.btn-component-subheader {
font-size: 0.875rem;
line-height: 1rem;
}
}
&.primary-container {
.btn-gradient {
@include primary-gradient();
}
@include btn-component($btn-primary-bevel-bd, $btn-primary-glow);
}
&.warning-container {
.btn-gradient {
@include warning-gradient();
}
@include btn-component($btn-warning-bevel-bd, $btn-warning-glow);
}
&.success-container {
.btn-gradient {
@include success-gradient();
}
@include btn-component($btn-success-bevel-bd, $btn-success-glow);
}
&.info-container {
.btn-gradient {
@include info-gradient();
}
@include btn-component($btn-info-bevel-bd, $btn-info-glow);
}
&.danger-container {
.btn-gradient {
@include danger-gradient();
}
@include btn-component($btn-danger-bevel-bd, $btn-danger-glow);
}
&.default-container {
.btn-border {
color: $btn-default-color;
border: $btn-default-border-width solid $btn-default-border;
}
@include btn-component($btn-default-bevel-bd, $btn-default-glow);
}
}
}
}

View file

@ -1,7 +1,6 @@
@mixin nga-layout-override($theme-name) {;
@mixin ngx-layout-theme($theme-name) {
// TODO: refactor this
/deep/ .layout {
.layout {
nga-layout-header > nav {
@ -56,4 +55,17 @@
}
}
}
nga-menu {
> ul > li:first-child {
a {
background-image: linear-gradient(to right, #664dd9, #9d52f2) !important;
box-shadow: 0 0 12px 0 rgba(128, 51, 255, 0.35) !important;
margin: 1rem;
border-radius: $nga-radius;
height: 3.5rem;
color: $nga-color-inverse;
}
}
}
}

View file

@ -0,0 +1,15 @@
@mixin ngx-misc-theme($theme-name) {
agm-map {
.agm-map-container-inner {
height: calc(#{$nga-card-height-xmedium} - 50px);
}
}
.leaflet-container {
height: calc(#{$nga-card-height-xmedium} - 50px);
}
.echart {
height: calc(#{$nga-card-height-xmedium} - 50px);
}
}

View file

@ -1,43 +0,0 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
@import '../components';
@import 'variables';
@import '~@nga/theme/styles/themes/nga.theme.cosmic';
@import 'overrides/all';
$theme-name: 'cosmic';
// @nga/theme module styles
@include nga-theme($theme-name) {
@include nga-theme-overrides($theme-name);
@include custom-components-theme($theme-name);
}
// @nga/bootstrap module styles
@import '~@nga/theme/overrides/bootstrap/styles/themes/nga.theme.default';
@include nga-bootstrap($theme-name);
// @nga/maps module styles
@import '~@nga/theme/overrides/maps/styles/themes/nga.theme.default';
@include nga-maps($theme-name);
// @nga/typography module styles
@import '~@nga/theme/overrides/typography/styles/themes/nga.theme.default';
@include nga-typography($theme-name);
// @nga/charts module styles
@import '~@nga/theme/overrides/charts/styles/themes/nga.theme.default';
@include nga-charts($theme-name);
// @nga/components module styles
@import '~@nga/theme/overrides/components/styles/themes/nga.theme.default';
@include nga-components($theme-name);
// @nga/tables module styles
@import '~@nga/theme/overrides/tables/styles/themes/nga.theme.default';
@include nga-tables($theme-name);

View file

@ -1,14 +0,0 @@
@mixin nga-menu-override($theme-name) {
/deep/ nga-menu {
> ul > li:first-child {
a {
background-image: linear-gradient(to right, #664dd9, #9d52f2) !important;
box-shadow: 0 0 12px 0 rgba(128, 51, 255, 0.35) !important;
margin: 1rem;
border-radius: $nga-radius;
height: 3.5rem;
color: $nga-color-inverse;
}
}
}
}

View file

@ -1,7 +0,0 @@
@import 'nga-layout';
@import 'nga-menu';
@mixin nga-theme-overrides($theme-name) {
@include nga-layout-override($theme-name);
@include nga-menu-override($theme-name);
}

View file

@ -0,0 +1,21 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
$nga-theme: 'cosmic';
@import '~@nga/theme/styles/themes/cosmic/theme';
@import './layout';
@import './buttons';
@import './misc';
@include nga-theme-install($nga-theme) {
@include ngx-layout-theme($nga-theme);
@include ngx-buttons-theme($nga-theme);
@include ngx-misc-theme($nga-theme);
};
@import '~@nga/auth/styles/themes/cosmic/theme';
@include nga-auth-install($nga-theme);

View file

@ -0,0 +1,114 @@
@mixin ngx-buttons-theme($theme-name) {
$btn-component-size: 50px;
$btn-component-bd-radius: 12px;
@mixin btn-component($bevel-bd, $glow) {
.btn-bevel-border {
box-shadow: 0 3px 0 0 $bevel-bd;
}
.btn-shadow {
box-shadow: 0 4px 10px 0 $nga-color-gradient-shadow;
}
.btn-glow {
box-shadow: 0 2px 12px 0 $glow;
}
}
.btn-hero-container {
padding-right: 0;
.container-title {
margin-bottom: 14px;
}
.container-btn {
margin-bottom: 24px;
}
.btn-components-container {
.btn-component {
display: flex;
.btn-gradient,
.btn-border,
.btn-bevel-border,
.btn-shadow,
.btn-glow {
width: $btn-component-size;
height: $btn-component-size;
border-radius: $btn-component-bd-radius;
margin-bottom: 16px;
}
.btn-component-details {
display: flex;
flex-direction: column;
justify-content: center;
margin-left: 17px;
height: $btn-component-size;
}
.btn-component-header {
color: white;
}
.btn-component-subheader {
font-size: 0.875rem;
line-height: 1rem;
}
}
&.primary-container {
.btn-gradient {
@include primary-gradient();
}
@include btn-component($btn-primary-bevel-bd, $btn-primary-glow);
}
&.warning-container {
.btn-gradient {
@include warning-gradient();
}
@include btn-component($btn-warning-bevel-bd, $btn-warning-glow);
}
&.success-container {
.btn-gradient {
@include success-gradient();
}
@include btn-component($btn-success-bevel-bd, $btn-success-glow);
}
&.info-container {
.btn-gradient {
@include info-gradient();
}
@include btn-component($btn-info-bevel-bd, $btn-info-glow);
}
&.danger-container {
.btn-gradient {
@include danger-gradient();
}
@include btn-component($btn-danger-bevel-bd, $btn-danger-glow);
}
&.default-container {
.btn-border {
color: $btn-default-color;
border: $btn-default-border-width solid $btn-default-border;
}
@include btn-component($btn-default-bevel-bd, $btn-default-glow);
}
}
}
}

View file

@ -0,0 +1,15 @@
@mixin ngx-misc-theme($theme-name) {
agm-map {
.agm-map-container-inner {
height: calc(#{$nga-card-height-xmedium} - 50px);
}
}
.leaflet-container {
height: calc(#{$nga-card-height-xmedium} - 50px);
}
.echart {
height: calc(#{$nga-card-height-xmedium} - 50px);
}
}

View file

@ -1,42 +0,0 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
@import '../components';
@import 'overrides/all';
@import '~@nga/theme/styles/themes/nga.theme.default';
$theme-name: 'default';
// @nga/theme module styles
@include nga-theme($theme-name) {
@include nga-theme-overrides($theme-name);
@include custom-components-theme($theme-name);
}
// @nga/bootstrap module styles
@import '~@nga/theme/overrides/bootstrap/styles/themes/nga.theme.default';
@include nga-bootstrap($theme-name);
// @nga/maps module styles
@import '~@nga/theme/overrides/maps/styles/themes/nga.theme.default';
@include nga-maps($theme-name);
// @nga/typography module styles
@import '~@nga/theme/overrides/typography/styles/themes/nga.theme.default';
@include nga-typography($theme-name);
// @nga/charts module styles
@import '~@nga/theme/overrides/charts/styles/themes/nga.theme.default';
@include nga-charts($theme-name);
// @nga/components module styles
@import '~@nga/theme/overrides/components/styles/themes/nga.theme.default';
@include nga-components($theme-name);
// @nga/tables module styles
@import '~@nga/theme/overrides/tables/styles/themes/nga.theme.default';
@include nga-tables($theme-name);

View file

@ -1,2 +0,0 @@
@mixin nga-theme-overrides($theme-name) {
}

View file

@ -0,0 +1,19 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
$nga-theme: 'default';
@import '~@nga/theme/styles/themes/default/theme';
@import './buttons';
@import './misc';
@include nga-theme-install($nga-theme) {
@include ngx-buttons-theme($nga-theme);
@include ngx-misc-theme($nga-theme);
};
@import '~@nga/auth/styles/themes/default/theme';
@include nga-auth-install($nga-theme);

View file

@ -0,0 +1,114 @@
@mixin ngx-buttons-theme($theme-name) {
$btn-component-size: 50px;
$btn-component-bd-radius: 12px;
@mixin btn-component($bevel-bd, $glow) {
.btn-bevel-border {
box-shadow: 0 3px 0 0 $bevel-bd;
}
.btn-shadow {
box-shadow: 0 4px 10px 0 $nga-color-gradient-shadow;
}
.btn-glow {
box-shadow: 0 2px 12px 0 $glow;
}
}
.btn-hero-container {
padding-right: 0;
.container-title {
margin-bottom: 14px;
}
.container-btn {
margin-bottom: 24px;
}
.btn-components-container {
.btn-component {
display: flex;
.btn-gradient,
.btn-border,
.btn-bevel-border,
.btn-shadow,
.btn-glow {
width: $btn-component-size;
height: $btn-component-size;
border-radius: $btn-component-bd-radius;
margin-bottom: 16px;
}
.btn-component-details {
display: flex;
flex-direction: column;
justify-content: center;
margin-left: 17px;
height: $btn-component-size;
}
.btn-component-header {
color: white;
}
.btn-component-subheader {
font-size: 0.875rem;
line-height: 1rem;
}
}
&.primary-container {
.btn-gradient {
@include primary-gradient();
}
@include btn-component($btn-primary-bevel-bd, $btn-primary-glow);
}
&.warning-container {
.btn-gradient {
@include warning-gradient();
}
@include btn-component($btn-warning-bevel-bd, $btn-warning-glow);
}
&.success-container {
.btn-gradient {
@include success-gradient();
}
@include btn-component($btn-success-bevel-bd, $btn-success-glow);
}
&.info-container {
.btn-gradient {
@include info-gradient();
}
@include btn-component($btn-info-bevel-bd, $btn-info-glow);
}
&.danger-container {
.btn-gradient {
@include danger-gradient();
}
@include btn-component($btn-danger-bevel-bd, $btn-danger-glow);
}
&.default-container {
.btn-border {
color: $btn-default-color;
border: $btn-default-border-width solid $btn-default-border;
}
@include btn-component($btn-default-bevel-bd, $btn-default-glow);
}
}
}
}

View file

@ -0,0 +1,15 @@
@mixin ngx-misc-theme($theme-name) {
agm-map {
.agm-map-container-inner {
height: calc(#{$nga-card-height-xmedium} - 50px);
}
}
.leaflet-container {
height: calc(#{$nga-card-height-xmedium} - 50px);
}
.echart {
height: calc(#{$nga-card-height-xmedium} - 50px);
}
}

View file

@ -1,42 +0,0 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
@import '../components';
@import 'overrides/all';
@import '~@nga/theme/styles/themes/nga.theme.light';
$theme-name: 'light';
// @nga/theme module styles
@include nga-theme($theme-name) {
@include nga-theme-overrides($theme-name);
@include custom-components-theme($theme-name);
}
// @nga/bootstrap module styles
@import '~@nga/theme/overrides/bootstrap/styles/themes/nga.theme.default';
@include nga-bootstrap($theme-name);
// @nga/maps module styles
@import '~@nga/theme/overrides/maps/styles/themes/nga.theme.default';
@include nga-maps($theme-name);
// @nga/typography module styles
@import '~@nga/theme/overrides/typography/styles/themes/nga.theme.default';
@include nga-typography($theme-name);
// @nga/charts module styles
@import '~@nga/theme/overrides/charts/styles/themes/nga.theme.default';
@include nga-charts($theme-name);
// @nga/components module styles
@import '~@nga/theme/overrides/components/styles/themes/nga.theme.default';
@include nga-components($theme-name);
// @nga/tables module styles
@import '~@nga/theme/overrides/tables/styles/themes/nga.theme.default';
@include nga-tables($theme-name);

View file

@ -1,2 +0,0 @@
@mixin nga-theme-overrides($theme-name) {
}

View file

@ -0,0 +1,19 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
$nga-theme: 'light';
@import '~@nga/theme/styles/themes/light/theme';
@import './buttons';
@import './misc';
@include nga-theme-install($nga-theme) {
@include ngx-buttons-theme($nga-theme);
@include ngx-misc-theme($nga-theme);
};
@import '~@nga/auth/styles/themes/light/theme';
@include nga-auth-install($nga-theme);