检测系统的主题色 检测系统的主题色window.addEventListener('theme-mode', event =>{ if(event.mode == 'dark'){} if(event.mode == 'light'){} })window.matchMedia('(prefers-color-scheme: dark)') .addEventListener('change', event => { if (event.matches) {} // dark mode})