Skip to content

Instantly share code, notes, and snippets.

@eperedo
Last active April 6, 2021 00:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eperedo/33fd3ee7f436d01d8a6fc6e63b87b1b3 to your computer and use it in GitHub Desktop.
Save eperedo/33fd3ee7f436d01d8a6fc6e63b87b1b3 to your computer and use it in GitHub Desktop.
Platzi light mode using invert πŸ™Š
function styleDarkMode() {
var filterStyle = document.createElement('style');
filterStyle.innerHTML =
':root{filter: invert(100%);}img, video { filter: invert(100%);}.vjs-fullscreen {background-color: white !important;filter: invert(1) !important;}';
document.head.appendChild(filterStyle);
}
// run styleDarkMode() in a page that has the dark mode (using the developer tools).
// you can see a preview of how it looks here https://user-images.githubusercontent.com/461124/113607722-2ab34680-960f-11eb-80ff-70599a7081bc.png
// awful, right? But no more eye strain (at least for me)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment