Advertisement
fauzanjeg

Hide Dark Mode Switch

Mar 19th, 2021 (edited)
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.49 KB | None | 0 0
  1. /* Hide Dark Mode Switch */
  2. (function ($) {
  3.     // dark-mode media query matched or not
  4.     let matched = window.matchMedia('(prefers-color-scheme: dark)').matches;
  5.  
  6.     if (matched) {
  7.         console.log('Currently in dark mode');
  8.         $('.jeg_dark_mode_toggle').trigger('click'); // With Switch || This Function save the dark mode cookie
  9.         $('.jeg_dark_mode').remove(); // Remove Dark Mode Switch
  10.     }
  11.     else {
  12.         console.log('Currently not in dark mode');
  13.     }
  14. }(jQuery))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement