From 21506a0d9eb6f3fdaf5938581d4bfd773d195ad1 Mon Sep 17 00:00:00 2001 From: Saltro <2373117747@qq.com> Date: Sun, 16 Apr 2023 17:29:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=80=82=E9=85=8D=E6=B7=B1=E8=89=B2?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=EF=BC=88svg=E8=BF=98=E6=9C=AA=E9=80=82?= =?UTF-8?q?=E9=85=8D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.vue | 5 +++++ assets/default.less | 4 ++++ assets/var.less | 15 +++++++++++++++ layouts/default.vue | 6 ++++++ 4 files changed, 30 insertions(+) diff --git a/app.vue b/app.vue index ba9785d..ce4e8c6 100644 --- a/app.vue +++ b/app.vue @@ -16,5 +16,10 @@ import './assets/default.less'; display: flex; justify-content: center; align-items: center; + background-color: var(--color-bg); +} + +:deep(*) { + color: var(--color-text); } diff --git a/assets/default.less b/assets/default.less index 0e7434c..ecf7d9e 100644 --- a/assets/default.less +++ b/assets/default.less @@ -3,3 +3,7 @@ padding: 0; font-family: -apple-system, 'PingFang SC', 'Microsoft Yahei', Arial, Helvetica, sans-serif, system-ui; } + +:root { + color-scheme: light dark; +} diff --git a/assets/var.less b/assets/var.less index b0b4b62..61f4549 100644 --- a/assets/var.less +++ b/assets/var.less @@ -1,5 +1,7 @@ :root { --color-primary: #01579B; + --color-bg: #FFFFFF; + --color-text: #000000; --color-input-bg: rgba(0, 123, 221, 0.05); --border-radius-m: 10px; --border-radius-l: 20px; @@ -9,3 +11,16 @@ --color-disabled: rgba(0, 0, 0, 0.25); --color-disabled-bg: rgba(0, 0, 0, 0.04); } + +@media (prefers-color-scheme: dark) { + :root { + --color-bg: #0D0D0D; + --color-text: #FFFFFF; + --color-primary: #0167B4; + --color-input-bg: #222222; + --color-secondary: #888888; + --color-button-secondary-bg: #262626; + --color-disabled: rgba(255, 255, 255, 0.82); + --color-disabled-bg: #000000; + } +} diff --git a/layouts/default.vue b/layouts/default.vue index 26c8e85..6d60ebc 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -16,6 +16,12 @@ border-radius: var(--border-radius-m); font-size: 15px; background-color: var(--color-input-bg); + + &::placeholder, + &::-webkit-input-placeholder, + &:-moz-placeholder { + color: var(--color-secondary); + } } :deep(label) {