Detect Darkmode
Posted: Mon Oct 28, 2019 2:03 pm
If you want to dynamically adjust your webapp to the user's preferred color scheme:
Code: Select all
! if(matchMedia('(prefers-color-scheme: dark)').matches) {
Debug "Darkmode"
! }
! if(matchMedia('(prefers-color-scheme: light)').matches) {
Debug "Lightmode"
! }