Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

detect browser theme

@media (prefers-color-scheme: dark) {
  // color variables for users which want your site to be dark
}
@media (prefers-color-scheme: light) {
  // color variables for users which want your site to be light
}
 
PREVIOUS NEXT
Tagged: #detect #browser #theme
ADD COMMENT
Topic
Name
6+9 =