From 4c37e0416fa3380a23c618aa4bf7c1fba87c2240 Mon Sep 17 00:00:00 2001 From: reuixiy Date: Mon, 4 Nov 2019 12:22:30 +0800 Subject: [PATCH] fix: make the color less depressed https://codyhouse.co/ds/globals/colors BREAKING CHANGE: config.toml changed Please change `primaryColorDark` to `201, 65%, 62%` by yourself. --- README.zh-cn.md | 2 +- assets/scss/_variables/dark.scss | 12 ++++++------ assets/scss/_variables/light.scss | 8 ++++---- assets/scss/main.scss | 2 +- exampleSite/config.toml | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index f8947ff6..f6a0ce02 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -588,7 +588,7 @@ duration = 0.5 # HSL 颜色值 primaryColorLight = "220, 90%, 56%" # 深色模式的主色 -primaryColorDark = "349, 75%, 51%" +primaryColorDark = "201, 65%, 62%" # 文章的内容宽度 # 如果为空(""),则用 42 作为默认值 diff --git a/assets/scss/_variables/dark.scss b/assets/scss/_variables/dark.scss index cfd511eb..db08e9b3 100644 --- a/assets/scss/_variables/dark.scss +++ b/assets/scss/_variables/dark.scss @@ -1,9 +1,9 @@ [data-theme="dark"] { @include defineColorHSL(--color-primary, $primaryColorDarkH, $primaryColorDarkS, $primaryColorDarkL); - @include defineColorHSL(--color-bg, 0, 0%, 10%); - @include defineColorHSL(--color-contrast-lower, 0, 0%, 15%); - @include defineColorHSL(--color-contrast-low, 0, 0%, 40%); - @include defineColorHSL(--color-contrast-medium, 0, 0%, 60%); - @include defineColorHSL(--color-contrast-high, 0, 0%, 80%); - @include defineColorHSL(--color-contrast-higher, 0, 0%, 90%); + @include defineColorHSL(--color-bg, 240, 8%, 12%); + @include defineColorHSL(--color-contrast-lower, 240, 6%, 19%); + @include defineColorHSL(--color-contrast-low, 240, 3%, 27%); + @include defineColorHSL(--color-contrast-medium, 240, 1%, 57%); + @include defineColorHSL(--color-contrast-high, 0, 0%, 89%); + @include defineColorHSL(--color-contrast-higher, 0, 0%, 100%); } \ No newline at end of file diff --git a/assets/scss/_variables/light.scss b/assets/scss/_variables/light.scss index 88e2ab09..a22229b4 100644 --- a/assets/scss/_variables/light.scss +++ b/assets/scss/_variables/light.scss @@ -8,10 +8,10 @@ @include defineColorHSL(--color-primary, $primaryColorLightH, $primaryColorLightS, $primaryColorLightL); @include defineColorHSL(--color-bg, 0, 0%, 100%); @include defineColorHSL(--color-contrast-lower, 0, 0%, 95%); - @include defineColorHSL(--color-contrast-low, 0, 0%, 80%); - @include defineColorHSL(--color-contrast-medium, 0, 0%, 40%); - @include defineColorHSL(--color-contrast-high, 0, 0%, 20%); - @include defineColorHSL(--color-contrast-higher, 0, 0%, 10%); + @include defineColorHSL(--color-contrast-low, 240, 1%, 83%); + @include defineColorHSL(--color-contrast-medium, 240, 1%, 48%); + @include defineColorHSL(--color-contrast-high, 240, 4%, 20%); + @include defineColorHSL(--color-contrast-higher, 240, 8%, 12%); } // return css color variable with different opacity value diff --git a/assets/scss/main.scss b/assets/scss/main.scss index a43d868f..e6f04723 100644 --- a/assets/scss/main.scss +++ b/assets/scss/main.scss @@ -68,7 +68,7 @@ @import "_variables/light.scss"; {{ if .Site.Params.enableDarkMode }} - {{ with .Site.Params.primaryColorDark | default "349, 75%, 51%" }} + {{ with .Site.Params.primaryColorDark | default "201, 65%, 62%" }} {{ $number := (split (replace . "%" "") ", ") }} {{ range $index, $value := $number }} {{ if eq $index 0 }} diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 0aa7589c..1dee1a4c 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -552,7 +552,7 @@ duration = 0.5 # HSL color primaryColorLight = "220, 90%, 56%" -primaryColorDark = "349, 75%, 51%" +primaryColorDark = "201, 65%, 62%" # Unit: em # You can leave it empty ("") to fallback to default value: 42