Skip to content

Commit bf9de2f

Browse files
hpyourdkmaster
authored andcommitted
[新增] 增加一套深色皮肤 (#906)
1 parent d158b87 commit bf9de2f

File tree

27 files changed

+1183
-22
lines changed

27 files changed

+1183
-22
lines changed

src/app/app.module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {AppComponent} from './app.component';
99
import {AjaxInterceptor} from './app.interceptor';
1010
import {DemoListComponent} from "./demo-list.component";
1111
import {routerConfig} from "./router-config";
12+
//import {JigsawTheme} from "../jigsaw/core/theming/theme";
1213

1314
{
1415
(<any[]>routerConfig).push(
@@ -36,4 +37,7 @@ import {routerConfig} from "./router-config";
3637
bootstrap: [AppComponent]
3738
})
3839
export class AppModule {
40+
constructor() {
41+
//JigsawTheme.majorStyle = 'dark';
42+
}
3943
}

src/app/live-demo-wrapper.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
.live-demo-wrap h2 {
1313
margin-bottom: 40px;
1414
color: #333;
15+
/*color: #fff;*/
1516
font-size: 24px;
1617
font-weight: 700;
1718
}
@@ -42,6 +43,7 @@
4243
.live-demo h3 {
4344
margin: 0 0 10px -10px;
4445
color: #333;
46+
/*color: #ccc;*/
4547
font-size: 16px;
4648
padding: 2px 14px;
4749
position: relative;
@@ -66,6 +68,7 @@
6668
.live-demo p.comment {
6769
margin-bottom: 10px;
6870
color: #666;
71+
/*color: #ccc;*/
6972
font-size: 14px;
7073
}
7174

@@ -84,6 +87,7 @@
8487
.live-demo p.message span {
8588
margin: 0 4px;
8689
color: #666;
90+
/*color: #ccc;*/
8791
}
8892

8993
/* toggle */

src/jigsaw/component/alert/alert.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ $alert-prefix-cls: #{$jigsaw-prefix}-alert;
88
}
99

1010
.#{$alert-prefix-cls} {
11-
background: $default-color;
11+
background: $component-background;
1212
border-radius: 4px;
1313
position: relative;
1414
padding: 0 10px 10px;

src/jigsaw/component/block/block.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $block-prefix-cls: #{$jigsaw-prefix}-block;
1515
bottom: 0;
1616
width: 100%;
1717
height: 100%;
18-
background: #000;
18+
background: #000 !important;
1919
opacity: 0.4;
2020
}
2121
}

src/jigsaw/component/button/button.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $btn-prefix-cls: #{$jigsaw-prefix}-button;
1717
font-weight: $btn-font-weight;
1818
user-select: none;
1919
@include prefixer(transition, all .3s $ease-in-out);
20-
background-color: #fff;
20+
background-color: $component-background;
2121
border: 1px solid $border-color-base;
2222
color: $text-color;
2323
&:before {

src/jigsaw/component/checkbox/checkbox.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ $checkbox-prefix-cls: #{$jigsaw-prefix}-checkbox;
4646
overflow: hidden;
4747
border: $border-width-base $border-style-base $border-color-base;
4848
border-radius: $border-radius-sm;
49-
background-color: #fff;
49+
background-color: $component-background;
5050
transition: all .3s;
5151

5252
&:after {

src/jigsaw/component/dialog/dialog.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ $dialog-prefix-cls: #{$jigsaw-prefix}-dialog;
2525

2626
.#{$dialog-prefix-cls} {
2727
position: relative;
28-
background: $default-color;
2928
border: 1px solid $border-color-base;
3029
border-radius: $border-radius-base;
3130
&-head {
@@ -34,7 +33,7 @@ $dialog-prefix-cls: #{$jigsaw-prefix}-dialog;
3433
padding: 14px 16px;
3534
color: $heading-color;
3635
font-size: 14px;
37-
background: $default-color;
36+
background: $component-background;
3837
border-bottom: 1px solid $border-color-base;
3938
cursor: move;
4039
[jigsaw-title] {
@@ -52,7 +51,12 @@ $dialog-prefix-cls: #{$jigsaw-prefix}-dialog;
5251
}
5352
}
5453

54+
&-content {
55+
background: $component-background;
56+
}
57+
5558
&-button-group {
59+
background: $component-background;
5660
border-top: 1px solid $border-color-base;
5761
text-align: center;
5862
height: 50px;

src/jigsaw/component/graph/graph.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import {CallbackRemoval, CommonUtils} from "../../core/utils/common-utils";
88
import {AbstractJigsawComponent} from "../common";
99
import {EchartOptions} from "../../core/data/echart-types";
1010
import {VMAX_GRAPH_THEME} from "./vmax-theme";
11+
import {VMAX_GRAPH_THEME_DARK} from './vmax-theme-dark';
12+
import {JigsawTheme} from "../../core/theming/theme";
1113

1214
@Component({
1315
selector: 'jigsaw-graph, j-graph',
@@ -78,7 +80,7 @@ export class JigsawGraph extends AbstractJigsawComponent implements OnInit, OnDe
7880
}
7981
}
8082

81-
private _globalTheme: any = VMAX_GRAPH_THEME;
83+
private _globalTheme: any = JigsawTheme.majorStyle == 'light' ? VMAX_GRAPH_THEME : JigsawTheme.majorStyle == 'dark' ? VMAX_GRAPH_THEME_DARK : VMAX_GRAPH_THEME;
8284

8385
@Input()
8486
public get globalTheme() {
@@ -87,11 +89,8 @@ export class JigsawGraph extends AbstractJigsawComponent implements OnInit, OnDe
8789

8890
public set globalTheme(value) {
8991
if (!value) return;
92+
value = value == 'light' ? VMAX_GRAPH_THEME : value == 'dark' ? VMAX_GRAPH_THEME_DARK : value;
9093
this._globalTheme = value;
91-
if (this._graph) {
92-
this._graph._theme = value;
93-
this.data.refresh();
94-
}
9594
}
9695

9796
constructor(private _elementRef: ElementRef, private _renderer: Renderer2, private _zone: NgZone) {
@@ -165,7 +164,7 @@ export class JigsawGraph extends AbstractJigsawComponent implements OnInit, OnDe
165164
this._zone.runOutsideAngular(() => {
166165
// echarts的Animation对象里的_startLoop方法有个递归调用requestAnimationFrame,会触发变更检查,见#289
167166
this._graph = echarts.init(this._graphContainer);
168-
this._graph._theme = VMAX_GRAPH_THEME;
167+
this._graph._theme = this.globalTheme;
169168
});
170169
this._listenWindowResize();
171170
if (this.data) {

0 commit comments

Comments
 (0)