Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

eventlistener dark mode

window.matchMedia('(prefers-color-scheme: dark)')
      .addEventListener('change', event => {
  if (event.matches) {
    //dark mode
  } else {
    //light mode
  }
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to disable autonumeric js 
Javascript :: html check template browser 
Javascript :: jquery like selector in javascript 
Javascript :: mongoose fails to connect to server when database is specified 
Javascript :: get JSON information into html control with javascript 
Javascript :: function find_max(nums) { 2 let max_num = Number.NEGATIVE_INFINITY; // smaller than all other numbers for (let num of nums) { if (num max_num) { // (Fill in the missing line here) } } return max_num; 
Javascript :: MERN stack implementing Sign in with Google. 
Javascript :: display only initials from full name reactjs 
Javascript :: flask server js return from folder 
Javascript :: django restframework jquery post 
Javascript :: react-resizable-rotatable-draggable 
Javascript :: Pure JavaScript Send POST NO JQUERY 
Javascript :: firestore save a score as a number not a string in js 
Javascript :: “new Set” is returning an empty set in nodejs 
Javascript :: react algoliasearch 
Javascript :: await zoomus.joinmeeting crashing app react native 
Javascript :: moment get end of next moenth 
Javascript :: Function to convert an Array to an Associative array 
Javascript :: select checkbox raitng in order javascript React 
Javascript :: srcset vue 
Javascript :: connect react native app to local api macos 
Javascript :: cancel drop down list onchange event javascript 
Javascript :: JS truthy value of void 
Javascript :: get current page rows in tabulator js 
Javascript :: javascript troubleshooting with jest 
Javascript :: fluentmigrator update row where 
Javascript :: check date clash js 
Javascript :: creating large element in js 
Javascript :: how to start v-for on a specific index 
Javascript :: React looping hooks to display in other hook 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =