jackbuehner / gmail-dark-modifications

Customizable Dark Theme for Gmail
https://github.com/jackbuehner/gmail-dark-modifications/raw/master/gmail-dark.less.user.css
35 stars 8 forks source link

Customizing the text color of the email content #3

Open ballII opened 5 years ago

ballII commented 5 years ago

I installed it via GitHub, which allows customization, but it does not seem to provide customization on the text color (or the text-background contrast in the dark version of the original font styling) of the email body. Could you consider adding this feature in the future? Or could you point out which part of the CSS code is responsible for the body text color? Thank you.

jackbuehner commented 5 years ago

Currently, the entire email body is just inverted (I believe this is actually how outlook.com implemented it's dark theme). As a result, there isn't really a spot in the code to set the color of the email body.

The reason I invert the email instead of manually setting the colors is that newsletters will typically override the color change or the color change will cause the text to be difficult to read.

Is there an issue with the current implementation? I may be able to add an option for changing the email text color, but it would be inconsistently implemented due to the nature of email styling.

ballII commented 5 years ago

Is there an issue with the current implementation? I may be able to add an option for changing the email text color, but it would be inconsistently implemented due to the nature of email styling.

I also use Dark Reader, and shown below is an example of its result: dark reader

whereas Gmail Dark Theme Tweaks looks like this: gmail dark

I am not sure whether the difference can be noticed by others, but the Dark Reader's result is apparently easier to read for me. However, Dark Reader does not render the Inbox page well (the unread emails cannot be easily distinguished from the read ones), so I have to discard it.

I don't know how Gmail Dark and Dark Reader handle the color inversion work differently. I think I would be satisfied with the ability to change the email text and/or background colors and have no problem letting the newsletters override the color change. Thank you very much.

jackbuehner commented 5 years ago

I actually just found a way for you the default text color to be changed while maintaining the text colors set by the newsletters by simply adding one line of code. In the css, change:

//invert and fix colors for email body
.gs > div:not(.gE):not(.wj) {
    filter: invert(93.2%) hue-rotate(180deg);
    background-color: #fff;
}

to

//invert and fix colors for email body
.gs > div:not(.gE):not(.wj) {
    filter: invert(93.2%) hue-rotate(180deg);
    background-color: #fff;
    color: #000;
}

For now, I'm not going to include this be default, so I suggest you create a new style from the manager with this code:

/* ==UserStyle==
@name           Higher contrast default email body text
@namespace      Jack Buehner
@version        1.0.0
@author         Jack Buehner
==/UserStyle== */

@-moz-document url-prefix("https://mail.google.com/mail") {
    .gs > div:not(.gE):not(.wj) {
        color: #000;
    }
}
ballII commented 5 years ago

@jackbuehner Thank you. The contrast did improve, but the font in the email content still looks a little bit "rotten" in detail compared to that in the composer. Is it possible to make the content font a little thicker (or make it render better) so that it looks the same as the composer font?

screen shot 2019-03-03 at 1 15 22 pm

teohhanhui commented 5 years ago

I think inverting the colours of the email content would only introduce more problems than it's worth. I'm getting weird artifacts like these:

Screenshot_2019-11-15 Re  symfony recipes  (WIP) Make tests faster by default (#530) - teohhanhui gmail com - Gmail

Screenshot_2019-11-15 Re  moby moby  Docker Network bypasses Firewall, no option to disable (#22054) - teohhanhui gmail com

Firefox version: 71.0b9

Perhaps there should be an option to disable inverting colours of email content, but only set the default colours. To me, not ruining email content is much more important than turning everything dark at all costs.

Update: Just tried turning off "Dark theme in email body", but it doesn't seem to change anything...