写了个小脚本才舒服
// nodeseek
function applyNodeSeekDarkMode(url) {
if (url) {
const urlObj = new URL(url);
const hostname = urlObj.hostname;
if (hostname.endsWith("nodeseek.com")) {
const isSystemDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
if (isSystemDark) {
document.cookie = "colorscheme=dark; path=/; domain=www.nodeseek.com; SameSite=Lax; max-age=31536000";
document.addEventListener('DOMContentLoaded', () => {
document.body.classList.replace('light-layout', 'dark-layout');
});
} else {
document.cookie = "colorscheme=light; path=/; domain=www.nodeseek.com; SameSite=Lax; max-age=31536000";
document.addEventListener('DOMContentLoaded', () => {
document.body.classList.replace('dark-layout', 'light-layout');
});
}
}
}
}
applyNodeSeekDarkMode(window.location.href)