Search
 
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
Name
7+7 =