Saturday, September 30, 2023
HomeSoftware DevelopmentDarkish Mode in One Line of Code!

Darkish Mode in One Line of Code!

[ad_1]

Dark mode has seemingly become the desired visual mode for websites and mobile apps alike. Dark mode is easier on the eyes, especially for those like me who like to burn the midnight oil by coding and reading tutorials. Unfortunately not all websites offer dark mode, so it’s up to me to remedy the situation.

Though it’s not a true “dark mode”, you can use CSS’ filter to create dark mode of your own:

html {
  filter: invert(1);
}

Inverting colors completely via 1 will make that light-themed website much more comfortable on your eyes. It’s important to realize that developers shouldn’t consider this a long-term solution, as it’s a quite lazy remedy and doesn’t lend well to branding.

  • How to Create a Twitter Card
  • Detect DOM Node Insertions with JavaScript and CSS Animations

[ad_2]
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments