DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
Detect Dark Mode
const
isDarkMode
=
window
.
matchMedia
&&
window
.
matchMedia
(
'(prefers-color-scheme: dark)'
)
.
match
;
Source by dev.to #
PREVIOUS
NEXT
Tagged:
#Detect
#Dark
#Mode
ADD COMMENT
Topic
COMMENT
Name
7+7 =
Submit