From c9445866379d8a09486b228411073791c0966536 Mon Sep 17 00:00:00 2001 From: Sergey Andrievskiy Date: Tue, 2 Jul 2019 11:38:03 +0300 Subject: [PATCH] fix(smart table): override success color with primary --- src/app/@theme/styles/themes.scss | 16 ++++++ .../smart-table/smart-table.component.scss | 55 +++++++++++++++++++ .../smart-table/smart-table.component.ts | 6 +- 3 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 src/app/pages/tables/smart-table/smart-table.component.scss diff --git a/src/app/@theme/styles/themes.scss b/src/app/@theme/styles/themes.scss index 2ee0b9e0..4a6051c5 100644 --- a/src/app/@theme/styles/themes.scss +++ b/src/app/@theme/styles/themes.scss @@ -24,6 +24,10 @@ $nb-themes: nb-register-theme(( slide-out-background: #f7f9fc, slide-out-shadow-color: 0 4px 14px 0 #8f9bb3, slide-out-shadow-color-rtl: 0 4px 14px 0 #8f9bb3, + + smart-table-bg-even: background-basic-color-2, + smart-table-bg-active: background-basic-color-3, + smart-table-paging-hover: transparent, ), default, default); $nb-themes: nb-register-theme(( @@ -47,6 +51,10 @@ $nb-themes: nb-register-theme(( slide-out-background: #252547, slide-out-shadow-color: 2px 0 3px #29157a, slide-out-shadow-color-rtl: -2px 0 3px #29157a, + + smart-table-bg-even: background-basic-color-2, + smart-table-bg-active: background-basic-color-3, + smart-table-paging-hover: transparent, ), cosmic, cosmic); $nb-themes: nb-register-theme(( @@ -70,6 +78,10 @@ $nb-themes: nb-register-theme(( slide-out-background: linear-gradient(270deg, #edf1f7 0%, #e4e9f2 100%), slide-out-shadow-color: 0 4px 14px 0 #8f9bb3, slide-out-shadow-color-rtl: 0 4px 14px 0 #8f9bb3, + + smart-table-bg-even: background-basic-color-2, + smart-table-bg-active: background-basic-color-3, + smart-table-paging-hover: transparent, ), corporate, corporate); $nb-themes: nb-register-theme(( @@ -93,4 +105,8 @@ $nb-themes: nb-register-theme(( slide-out-background: linear-gradient(270deg, #222b45 0%, #151a30 100%), slide-out-shadow-color: 0 4px 14px 0 #8f9bb3, slide-out-shadow-color-rtl: 0 4px 14px 0 #8f9bb3, + + smart-table-bg-even: background-basic-color-2, + smart-table-bg-active: background-basic-color-3, + smart-table-paging-hover: transparent, ), dark, dark); diff --git a/src/app/pages/tables/smart-table/smart-table.component.scss b/src/app/pages/tables/smart-table/smart-table.component.scss new file mode 100644 index 00000000..6c585cf4 --- /dev/null +++ b/src/app/pages/tables/smart-table/smart-table.component.scss @@ -0,0 +1,55 @@ +@import '../../../@theme/styles/themes'; + +@include nb-install-component() { + nb-card { + transform: translate3d(0, 0, 0); + } + + ng2-smart-table ::ng-deep { + .ng2-smart-action-add-add { + background-color: nb-theme(button-filled-primary-background-color); + border-color: nb-theme(button-filled-primary-border-color); + color: nb-theme(button-filled-primary-text-color); + + &:focus { + border-color: nb-theme(button-filled-primary-focus-border-color); + } + + &:hover { + background-color: nb-theme(button-filled-primary-hover-background-color); + border-color: nb-theme(button-filled-primary-hover-border-color); + } + + &:active { + background-color: nb-theme(button-filled-primary-active-background-color); + border-color: nb-theme(button-filled-primary-active-border-color); + } + } + + nav.ng2-smart-pagination-nav .pagination li { + a, > span { + background-color: transparent; + color: nb-theme(button-outline-primary-text-color); + + &:focus { + border-color: nb-theme(button-outline-primary-focus-border-color); + color: nb-theme(button-outline-primary-focus-text-color); + } + + &:hover { + border-color: nb-theme(button-outline-primary-hover-border-color); + color: nb-theme(button-outline-primary-hover-text-color); + } + } + } + + .ng2-smart-pagination .page-item.disabled { + .page-link, + .page-link:focus, + .page-link:hover { + background-color: transparent; + color: nb-theme(button-outline-primary-disabled-text-color); + } + } + } +} diff --git a/src/app/pages/tables/smart-table/smart-table.component.ts b/src/app/pages/tables/smart-table/smart-table.component.ts index 00da51fc..89c8ec59 100644 --- a/src/app/pages/tables/smart-table/smart-table.component.ts +++ b/src/app/pages/tables/smart-table/smart-table.component.ts @@ -6,11 +6,7 @@ import { SmartTableData } from '../../../@core/data/smart-table'; @Component({ selector: 'ngx-smart-table', templateUrl: './smart-table.component.html', - styles: [` - nb-card { - transform: translate3d(0, 0, 0); - } - `], + styleUrls: ['./smart-table.component.scss'], }) export class SmartTableComponent {