When using the dark theme, text in emails is less legible. Something is ‘off’ with the font smoothing for the text that makes it look worse than the light mode version. The text in the UI is fine; it’s just text in the email itself that has the issue.
It looks like this is caused by the invert + hue rotation filter . If I use the devtools to remove the filter: invert(100%) hue-rotate(180deg) filter from the body within the iframe, it fixes the text rendering.
Of course, that means the email is no longer displayed in “dark mode”, but I’d be content with a dark UI + light email content, unless there’s a proper fix that’s easier.
I don’t think CSS alone is sufficient for a good working implementation of dark mode emails… There’s just too many edge cases. The new Facebook redesign uses a similar approach for “fake dark mode” on legacy pages that haven’t been migrated to the new framework yet, and it has similar issues with text rendering, and scroll performance isn’t as good as it should be.
I think a working implementation of “automatic dark mode” for emails would need to actually walk the DOM, read the background and text colours of each element using getComputedStyle, and modify the CSS, flipping the colours where needed. That could also solve the issue of dark text on a dark background as the code could measure the contrast ratio and flip the colour of the text based on the background colour.
If you have any Javascript or Typescript skills, you’d be welcome to dig into Mailspring’s source code and implement an option in the Appearance settings for separately toggling Dark Emails. It’d make an excellent stop-gap for the ongoing problems we’re having with this feature, and besides, not everyone wants dark-mode emails to go with the dark-mode interface. I think that PR would be very likely to get accepted.
I’ve got JavaScript/TypeScript skills, I’ll just have to find the time to look into it. I’m usually pretty busy so can’t promise anything, but maybe I’ll get around to it
Good idea for some mails. But I love the dark theme for read mail (this works great for me for the majority of emails). A good option should be a button close to mail to set it temporarily in light mode. This is done on some mail clients for android, and solves the problem that dark theme can have sometimes on mail contents. Better idea than a config in preferences view which make switch between light/dark on mail content only.
I hope you understand my idea, unless my english is not perfect
I’m still interested in fixing this by improving how the dark mode works (and maybe adding a toggle to switch between dark and light mode just for the email content), but Mailspring is very unstable for me and I get errors basically every day I try to use it (Lots of errors after archiving a large number of emails), so I’m not really using it any more and thus haven’t really gotten around to working on this yet.