Is it possible to use JavaScript to switch between light mode and darkmode on a page?

前端 未结 0 743
无人及你
无人及你 2021-01-13 21:33

I can use

@media (prefers-color-scheme: dark)

or

window.matchMedia(\'(prefers-color-scheme: dark)\').matches

相关标签:
回答
  • 消灭零回复
提交回复
热议问题