Dark mode in one line of code!


Dark mode seems to have become a required visual mode for websites and mobile applications. Dark mode is easier for the eyes, especially for people like me who like to turn on the lights by coding and reading tutorials. Unfortunately, not all websites offer dark mode, so I have to solve this problem.

Although it is not a true “dark mode”, you can use CSS’ filter Create your own dark mode:

html {
  filter: invert(1);
}

By completely inverting the colors 1 It will make that light-themed website more comfortable for your eyes. It is important to realize that developers should not consider it as a long-term solution because it is a very lazy remedy and is not conducive to branding.


Leave a Reply

Your email address will not be published. Required fields are marked *