showing results for - "eventlistener dark mode"
Luisa
24 May 2017
1window.matchMedia('(prefers-color-scheme: dark)')
2      .addEventListener('change', event => {
3  if (event.matches) {
4    //dark mode
5  } else {
6    //light mode
7  }
8})