1
0
Fork 0

Merge pull request #176 from windbelike/main

Update header.html
This commit is contained in:
南小北 2023-06-26 15:55:18 +08:00 committed by GitHub
commit bc9c24403f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,7 +34,7 @@
// dark theme // dark theme
const metaTheme = document.querySelector('meta[name="theme-color"]'); const metaTheme = document.querySelector('meta[name="theme-color"]');
const lightBg = `{{ $.Scratch.Get "bg_color" }}`.replace(/"/g, ''); const lightBg = "{{ $.Scratch.Get `bg_color` }}".replace(/"/g, '');
const setDark = (isDark) => { const setDark = (isDark) => {
metaTheme.setAttribute('content', isDark ? '#000' : lightBg); metaTheme.setAttribute('content', isDark ? '#000' : lightBg);
htmlClass[isDark ? 'add' : 'remove']('dark'); htmlClass[isDark ? 'add' : 'remove']('dark');