Dark Theme and Email

I’ve noticed that while using the Dark Theme in Workspaces, some emails aren’t displayed correctly.

For example by default using the Light Theme, an email might have a white background with black text. But while using the Dark Theme, the background is still white, but the text is changed… to also white. This makes parts of, or in some cases the entire email, unreadable.

Can I highly and I mean HIGHLY suggest that the Dark Theme NOT change or manipulate the color theme of any email. I’ve seen many attempts at this “adaptive” theming with email and it just never works properly. There are too many unknowns in the structure and theming of an Email message to be able to reliably convert the theme on the fly. NextCloud tries to do the same exact thing, with the same exact results - unreadable email.

If you really want to fix it, I’ve found that in a lot of cases, this CAN be fixed by changing:

#itemContainer .body,.message-print-box .body,#pageActionContainer .body {
    font-weight: inherit;
    font-style: inherit;
    font-size: inherit;
    vertical-align: baseline;
    overflow-y: hidden;
    overflow-x: auto;
    width: auto;
    padding-bottom: 8px;
    padding-top: 8px;
    background-color: #333;
    color: #fff;
    min-height: 200px;
    margin-top: 8px
}

to

#itemContainer .body,.message-print-box .body,#pageActionContainer .body {
    font-weight: inherit;
    font-style: inherit;
    font-size: inherit;
    vertical-align: baseline;
    overflow-y: hidden;
    overflow-x: auto;
    width: auto;
    padding-bottom: 8px;
    padding-top: 8px;
    background-color: #333;
    color: #000;
    min-height: 200px;
    margin-top: 8px
}

I’m just changing “color” from #fff to #000.

This is from:

dark-mail-8FdRINQnzkjOZwkJghr6sQ2.css?ver=12.7.1.1942

I believe this is located in:
discbundle/mail/css

or at least, that’s what I could gather from poking around with the dev tools in Chrome.

Please let me know if this is better submitted elsewhere as a bug report or something.

Hello @austin3410
Please specify the exact steps to reproduce the situation. I have changed interface theme in the profile, but emails look OK:


This issue doesn’t happen when viewing simple emails with just text.
It’s most common from more complex emails that are made up of different HTML elements.

Here’s one example, there’s text in the white space of the email but I can’t see it unless I click and drag over the white space to “highlight” all the hidden text. If I view this email in the Light Theme, the background is still white, but the text is black.

I would share more examples but a lot of them contain personal information that would be difficult to remove while still showing the problem, but I can try if needed.