From 8a3f85528235372b42911a855409bb2ca8523da2 Mon Sep 17 00:00:00 2001 From: JimQing Date: Sun, 17 May 2020 16:53:21 +0800 Subject: [PATCH 1/3] feature: dark-theme --- public/assets/css/loading.css | 4 ++ src/App.vue | 2 +- src/assets/images/light.png | Bin 0 -> 5731 bytes src/assets/images/night.png | Bin 0 -> 5597 bytes src/assets/less/theme.less | 62 ++++++++++++++++++ src/components/codeMirror/header.vue | 56 +++++++++++----- src/main.js | 7 +- src/router/index.js | 29 -------- src/store/index.js | 6 +- src/{components => view}/CodemirrorEditor.vue | 21 +++--- src/views/About.vue | 5 -- src/views/Home.vue | 14 ---- 12 files changed, 129 insertions(+), 77 deletions(-) create mode 100644 src/assets/images/light.png create mode 100644 src/assets/images/night.png create mode 100644 src/assets/less/theme.less delete mode 100644 src/router/index.js rename src/{components => view}/CodemirrorEditor.vue (94%) delete mode 100644 src/views/About.vue delete mode 100644 src/views/Home.vue diff --git a/public/assets/css/loading.css b/public/assets/css/loading.css index f91fef5..aea6b19 100644 --- a/public/assets/css/loading.css +++ b/public/assets/css/loading.css @@ -8,6 +8,10 @@ background-color: #f2f2f2; } +.loading_night { + background-color: #303133; +} + .loading-wrapper { position: fixed; top: 50%; diff --git a/src/App.vue b/src/App.vue index 50a4640..4efd1a1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,7 +5,7 @@ From 1d822fb6ef692626281c8c77c61dad2d85a90b1c Mon Sep 17 00:00:00 2001 From: JimQing Date: Sun, 17 May 2020 18:16:26 +0800 Subject: [PATCH 2/3] feature: dialog-night --- src/assets/less/theme.less | 34 +++++++++++++++++------ src/components/codeMirror/aboutDialog.vue | 2 +- src/components/codeMirror/header.vue | 12 ++++---- src/components/codeMirror/insertForm.vue | 12 +++++--- src/view/CodemirrorEditor.vue | 5 ++++ 5 files changed, 46 insertions(+), 19 deletions(-) diff --git a/src/assets/less/theme.less b/src/assets/less/theme.less index 46342c3..3815277 100644 --- a/src/assets/less/theme.less +++ b/src/assets/less/theme.less @@ -6,11 +6,14 @@ @nightFontColor: gray; @nightLinkColor: #8e9eb9; @nightLinkTextColor: #84868b; -@nightBorderColor: #ffffff; +@nightWhiteColor: #ffffff; @nightButtonBg: #1e1e1e; @nightButtonHoverColor: #84868b; .container_night { background-color: @nightBgColor; + .el-main { + background-color: @nightBgColor; + } .CodeMirror { caret-color: @nightFontColor; color: @nightFontColor; @@ -25,7 +28,11 @@ background-color: @nightCodeMirrorColor; box-shadow: inset 0 0 0 1px rgba(233, 231, 231, 0.102); } - .cm-s-xq-light span.cm-variable-2 { + .cm-s-style-mirror .CodeMirror-matchingbracket { + color: @nightWhiteColor!important; + background: rgb(30, 30, 30)!important; + } + .cm-s-xq-light span.cm-variable-2, .cm-s-style-mirror span.cm-tag { color: @nightFontColor; } .cm-s-xq-light .CodeMirror-activeline-background { @@ -41,20 +48,31 @@ background-color: @nightHeaderColor; } .el-button { - color: @nightBorderColor; + color: @nightWhiteColor; background-color: @nightCodeMirrorColor; - border: 1px solid #eeeeee; + border: 1px solid transparent; } .el-button.is-plain:focus, .el-button.is-plain:hover { background: @nightButtonBg; - color: @nightButtonHoverColor; - border: 1px solid @nightButtonHoverColor; + color: @nightWhiteColor; + border: 1px solid @nightWhiteColor; i { - color: @nightButtonHoverColor; + color: @nightWhiteColor; + } + } + .insert__dialog, .about__dialog { + .el-dialog { + background-color: @nightBgColor; + } + .el-dialog__body { + color: @nightWhiteColor; + } + .el-dialog__title, .el-form-item__label { + color: @nightWhiteColor; } } i { - color: #ffffff; + color: @nightWhiteColor; } ::-webkit-scrollbar { background-color: @nightCodeMirrorColor; diff --git a/src/components/codeMirror/aboutDialog.vue b/src/components/codeMirror/aboutDialog.vue index 055e894..dc4d8d3 100644 --- a/src/components/codeMirror/aboutDialog.vue +++ b/src/components/codeMirror/aboutDialog.vue @@ -1,5 +1,5 @@