How to Create a Favicon for Dark Mode?

Dark mode is getting wildly popular these days ever since Apple shipped it with Mojave. However, the usefulness of dark mode can be negated by websites that are predominantly white. That’s why Webkit introduced a media query attribute, prefers-color-scheme, to enable developers to apply styles specific to dark mode. As of April 2019, the support for it is still poor, but it’s on the roadmap for both Firefox and Chrome. The support percentage is bound to climb up once both these browsers start supporting it.