Skip to content

Instantly share code, notes, and snippets.

@Jeremie-Chauvel
Created November 23, 2020 23:14
Show Gist options
  • Save Jeremie-Chauvel/075eab2c8f6026aa6bfe5259cf486f96 to your computer and use it in GitHub Desktop.
Save Jeremie-Chauvel/075eab2c8f6026aa6bfe5259cf486f96 to your computer and use it in GitHub Desktop.
Dark mode toggle bookmarklet

Dark mode toggle bookmarklet

To use this simply create a new bookmark and copy past the code in the url field. Then you only need to click on the bookmark to execute the script.

javascript: (function () {
  if (document.children[0].style['filter']) {
    document.children[0].style['filter'] = ''
  } else {
    document.children[0].style['filter'] = 'invert(100%) hue-rotate(180deg)'
  }
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment