From 43e63d3124c76df5c2d8bf8e36b9876e1ddc63c4 Mon Sep 17 00:00:00 2001
From: Dmitry Nehaychik <4dmitr@gmail.com>
Date: Mon, 20 May 2019 18:45:39 +0300
Subject: [PATCH] feat(themes): add new Dark theme!
---
.../live-example-block.component.scss | 13 +++-
.../live-example-block.component.ts | 6 ++
docs/articles/auth-install.md | 2 +-
docs/articles/bootstrap-integration.md | 3 +-
docs/articles/concept-theme-system.md | 5 +-
.../layout-theme-toggle.component.ts | 3 +-
src/framework/theme/styles/_themes.scss | 1 +
src/framework/theme/styles/prebuilt/dark.scss | 7 +++
.../theme/styles/themes/_cosmic.scss | 61 +------------------
src/framework/theme/styles/themes/_dark.scss | 42 +++++++++++++
.../theme/styles/themes/_default.scss | 13 ++--
11 files changed, 84 insertions(+), 72 deletions(-)
create mode 100644 src/framework/theme/styles/prebuilt/dark.scss
create mode 100644 src/framework/theme/styles/themes/_dark.scss
diff --git a/docs/app/blocks/components/live-example-block/live-example-block.component.scss b/docs/app/blocks/components/live-example-block/live-example-block.component.scss
index 932ba41e07..1a1765d3a3 100644
--- a/docs/app/blocks/components/live-example-block/live-example-block.component.scss
+++ b/docs/app/blocks/components/live-example-block/live-example-block.component.scss
@@ -8,8 +8,10 @@
$action-fg: nb-theme(color-fg-heading-light);
$block-bg-default: #f7f8fa;
$block-bg-cosmic: #292766;
- $block-bg-corporate: #f7f8fa;
$block-fg-cosmic: #e8e9fa;
+ $block-bg-corporate: #f7f8fa;
+ $block-bg-dark: #232a39;
+ $block-fg-dark: #f7f8fa;
display: flex;
flex-direction: column;
@@ -102,8 +104,13 @@
.title {
color: white;
}
- .action-item {
- color: $block-fg-cosmic;
+ }
+
+ &.theme-dark {
+ background-color: $block-bg-dark;
+
+ .title {
+ color: white;
}
}
diff --git a/docs/app/blocks/components/live-example-block/live-example-block.component.ts b/docs/app/blocks/components/live-example-block/live-example-block.component.ts
index ec47a707bb..18783fc880 100644
--- a/docs/app/blocks/components/live-example-block/live-example-block.component.ts
+++ b/docs/app/blocks/components/live-example-block/live-example-block.component.ts
@@ -45,11 +45,17 @@ export class NgdLiveExampleBlockComponent implements OnInit, AfterViewInit, OnDe
return this.currentTheme === 'corporate';
}
+ @HostBinding('class.theme-dark')
+ private get isDark() {
+ return this.currentTheme === 'dark';
+ }
+
iframeHeight = 0;
alive: boolean = true;
themes: {label: string; value: string}[] = [
{ label: 'Default', value: 'default' },
+ { label: 'Dark', value: 'dark' },
{ label: 'Cosmic', value: 'cosmic' },
{ label: 'Corporate', value: 'corporate' },
];
diff --git a/docs/articles/auth-install.md b/docs/articles/auth-install.md
index f3159bfcd2..66bd85d583 100644
--- a/docs/articles/auth-install.md
+++ b/docs/articles/auth-install.md
@@ -141,7 +141,7 @@ Last but not least - install the component styles into your styles.scss ([more d
```
-`@import '~@nebular/auth/styles/all'` means import auth styles for all themes (default, cosmic, corporate). If you have only one or portion of themes enabled, then you need to import auth styles only for enabled themes. For example, when only default and corporate themes enabled, auth imports should look like this:
+`@import '~@nebular/auth/styles/all'` means import auth styles for all themes (default, dark, corporate, cosmic). If you have only one or portion of themes enabled, then you need to import auth styles only for enabled themes. For example, when only default and corporate themes enabled, auth imports should look like this:
```scss
@import '~@nebular/auth/styles/themes/default';
@import '~@nebular/auth/styles/themes/corporate';
diff --git a/docs/articles/bootstrap-integration.md b/docs/articles/bootstrap-integration.md
index c7d104cb22..d9dec61dda 100644
--- a/docs/articles/bootstrap-integration.md
+++ b/docs/articles/bootstrap-integration.md
@@ -29,9 +29,10 @@ Then if you just want to use predefined themes you have to import prebuilt style
```json
"styles": [
- "node_modules/@nebular/bootstrap/styles/prebuilt/cosmic.css",
+ "node_modules/@nebular/bootstrap/styles/prebuilt/dark.css",
"node_modules/@nebular/bootstrap/styles/prebuilt/default.css",
"node_modules/@nebular/bootstrap/styles/prebuilt/corporate.css",
+ "node_modules/@nebular/bootstrap/styles/prebuilt/cosmic.css"
]
```
diff --git a/docs/articles/concept-theme-system.md b/docs/articles/concept-theme-system.md
index 9cc7a5c219..c3c9e5715e 100644
--- a/docs/articles/concept-theme-system.md
+++ b/docs/articles/concept-theme-system.md
@@ -93,10 +93,11 @@ Depending on the currently enabled theme and the way `card-bg` inherited in your
Currently, there are 3 built-in themes:
- `default` - clean white theme
-- `cosmic` - dark theme
+- `dark` - dark theme
+- `cosmic` - alternative dark violet theme
- `corporate` - firm business theme
-Themes can also be inherited from each other, `cosmic`, for instance, is inherited from the `default` theme.
+Themes can also be inherited from each other, `cosmic`, for instance, is inherited from the `dark` theme.