My implementation involves a one-line change to default.hbs which can’t be done via code injection.
However, if you don’t want the option for Light mode or the option to for the mode to switch automatically, then it would be possible to read through my CSS, understand how to adapt it for that case, and then use code injection for a dark mode. It would be up to you to made that adaptation if you want to try it.
Site performance will be slightly better if code injection is avoided though. When CSS is implemented in screen.css, it can be loaded once and cached.
Whatever you add through Code Injection is loaded repeatedly on every page.
Thank you for sharing this. I am using Journal free theme from Ghost marketplace and would like to add also this light/dark mode feature that depends on reader settings. Is it possible to do it the same way that you proceed with Headline ? Also, where can I find the code you added to add this feature in Headline ?