Last active
April 6, 2021 00:55
-
-
Save eperedo/33fd3ee7f436d01d8a6fc6e63b87b1b3 to your computer and use it in GitHub Desktop.
Platzi light mode using invert π
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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