From 37f1d60f82373036f54116ea637c436e236d21d7 Mon Sep 17 00:00:00 2001 From: LouisLam Date: Fri, 13 Aug 2021 00:23:40 +0800 Subject: [PATCH] also change meta tag theme-color --- index.html | 11 +++++------ src/mixins/theme.js | 12 ++++++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 2a4d4e5d9..61d0f42b0 100644 --- a/index.html +++ b/index.html @@ -1,13 +1,12 @@ - - + + - - - - + + + Uptime Kuma diff --git a/src/mixins/theme.js b/src/mixins/theme.js index 5b4c831d7..98b605a7a 100644 --- a/src/mixins/theme.js +++ b/src/mixins/theme.js @@ -14,6 +14,7 @@ export default { } document.body.classList.add(this.theme); + this.updateThemeColorMeta(); }, computed: { @@ -33,6 +34,17 @@ export default { theme(to, from) { document.body.classList.remove(from); document.body.classList.add(this.theme); + this.updateThemeColorMeta(); + } + }, + + methods: { + updateThemeColorMeta() { + if (this.theme === "dark") { + document.querySelector("#theme-color").setAttribute("content", "#161B22"); + } else { + document.querySelector("#theme-color").setAttribute("content", "#5cdd8b"); + } } } }