Page 1 of 1

Detect Darkmode

Posted: Mon Oct 28, 2019 2:03 pm
by Dirk Geppert
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"
! }

Re: Detect Darkmode

Posted: Tue Nov 05, 2019 10:33 am
by Fred
Cool stuff !