From cfc1497c12c96922c913737518decf728920419f Mon Sep 17 00:00:00 2001 From: reco_luan Date: Mon, 16 Mar 2020 10:44:43 +0800 Subject: [PATCH 1/2] fix: dark mode style --- components/Mode/ModePicker.vue | 14 +++----------- components/Mode/modeOptions.js | 4 ++-- components/Page.vue | 5 ++--- styles/palette.styl | 4 ++-- 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/components/Mode/ModePicker.vue b/components/Mode/ModePicker.vue index 8c1108a..b9602dc 100644 --- a/components/Mode/ModePicker.vue +++ b/components/Mode/ModePicker.vue @@ -33,25 +33,17 @@ export default { const mode = localStorage.getItem('mode') const { mode: customizeMode } = this.$themeConfig this.currentMode = mode === null ? customizeMode === undefined ? 'auto' : customizeMode : mode - if (customizeMode === null) { - activateMode('light') - } else if (mode === 'dark') { - activateMode('dark') - } else if (mode === 'light') { - activateMode('light') - } + activateMode(this.currentMode) }, methods: { selectMode (mode) { if (mode.mode === this.currentMode) { return - } else if (mode.mode === 'dark') { - activateMode('dark') - } else if (mode.mode === 'light') { - activateMode('light') } else if (mode.mode === 'auto') { setMode() + } else { + activateMode(mode.mode) } localStorage.setItem('mode', mode.mode) this.currentMode = mode.mode diff --git a/components/Mode/modeOptions.js b/components/Mode/modeOptions.js index d975278..7937f3e 100644 --- a/components/Mode/modeOptions.js +++ b/components/Mode/modeOptions.js @@ -29,10 +29,10 @@ const modeOptions = { '--default-color-3': 'rgba(0, 0, 0, .3)', '--default-color-2': 'rgba(0, 0, 0, .2)', '--default-color-1': 'rgba(0, 0, 0, .1)', - '--background-color': '#25272a', + '--background-color': '#202124', '--box-shadow': '0 1px 6px 0 rgba(0, 0, 0, .9)', '--box-shadow-hover': '0 2px 26px 0 rgba(0, 0, 0, .9)', - '--text-color': '#aaa', + '--text-color': '#fff', '--border-color': 'rgba(0, 0, 0, .3)', '--code-color': 'rgba(0, 0, 0, .3)', '--mask-color': '#000' diff --git a/components/Page.vue b/components/Page.vue index db523e7..1bc09ef 100644 --- a/components/Page.vue +++ b/components/Page.vue @@ -91,7 +91,6 @@ export default { computed: { showAccessNumber () { - console.log(this) return this.$themeConfig.commentsSolution === 'valine' }, lastUpdated () { @@ -232,14 +231,14 @@ function flatten (items, res) { .edit-link display inline-block a - color lighten($textColor, 25%) + color $accentColor margin-right 0.25rem .last-updated float right font-size 0.9em .prefix font-weight 500 - color lighten($textColor, 25%) + color $accentColor .time font-weight 400 color #aaa diff --git a/styles/palette.styl b/styles/palette.styl index be5a960..977640c 100644 --- a/styles/palette.styl +++ b/styles/palette.styl @@ -26,7 +26,7 @@ $lineNumbersWrapperWidth = 2.5rem $textColorSub = #888 $backgroundColor ?= #fff -$backgroundColorDark ?= #25272a +$backgroundColorDark ?= #202124 $boxShadow = 0 1px 6px 0 $darkColor2 $boxShadowHover = 0 2px 16px 0 $darkColor2 @@ -34,7 +34,7 @@ $boxShadowDark = 0 1px 6px 0 $darkColor6 $boxShadowHoverDark = 0 2px 16px 0 $darkColor6 $textColor ?= #2c3e50 -$textColorDark ?= #aaa +$textColorDark ?= #fff $borderColor ?= #eaecef $borderColorDark ?= $darkColor3 From 5343fe7e91d53d76b899c8eb78db5c3b98d0739a Mon Sep 17 00:00:00 2001 From: reco_luan Date: Mon, 16 Mar 2020 10:45:29 +0800 Subject: [PATCH 2/2] VERSON 1.3.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 461d030..8d621ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vuepress-theme-reco", - "version": "1.3.0", + "version": "1.3.1", "description": "A simple and beautiful vuepress Blog & Doc theme.", "main": "index.js", "scripts": {