-
-
Save cferdinandi/28a8896007cd26d91c6b8a403f4180b3 to your computer and use it in GitHub Desktop.
var toggleNightMode = function () { | |
var nightMode = document.querySelector('#night-mode-styles'); | |
if (nightMode) { | |
nightMode.parentNode.removeChild(nightMode); | |
return; | |
} | |
var ref = window.document.getElementsByTagName('script')[0]; | |
nightMode = document.createElement('style'); | |
nightMode.id = 'night-mode-styles'; | |
nightMode.innerHTML = 'body{filter:invert(1) hue-rotate(180deg);background:#000000;}iframe,img,video{filter:invert(1) hue-rotate(180deg);}img{opacity:0.7;}img:hover{opacity:1;}'; | |
ref.parentNode.insertBefore(nightMode, ref); | |
}; |
@Geodine this is for websites, not apps or operating systems, and was part of an article on night mode for website CSS. It's not the approach I'd recommend today. Instead, I'd direct folks here: https://gomakethings.com/how-to-create-a-dark-mode-theme-for-your-site-or-app/
@Geodine this is for websites, not apps or operating systems, and was part of an article on night mode for website CSS. It's not the approach I'd recommend today. Instead, I'd direct folks here: https://gomakethings.com/how-to-create-a-dark-mode-theme-for-your-site-or-app/
I’m asking this specifically because of Brave's AI assistant told me that the version of NightMode that was made by you was formerly used as Brave's NightMode for the mobile iOS version. So I'd like to see if that is true or not to remove any mysticism from this.
How can I use this on my mobile iOS devices?