emailmonday / Cerberus

A few simple, but solid patterns for responsive HTML email templates and newsletters. Even in Outlook and Gmail.

Home Page:https://www.cerberusemail.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Safe to remove Gmail-targeting CSS?

TedGoas opened this issue · comments

There are a few instances where Cerberus attempts to target Gmail and nullify something it's trying to do that we don't want.

.unstyle-auto-detected-links a,
.aBn {
    border-bottom: 0 !important;
    cursor: default !important;
    color: inherit !important;
    text-decoration: none !important;
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
}
/* What it does: Prevents Gmail from changing the text color in conversation threads. */
.im {
    color: inherit !important;
}
/* What it does: Prevents Gmail from displaying a download button on large, non-linked images. */
.a6S {
    display: none !important;
    opacity: 0.01 !important;
}

However it seems that Gmail automatically and uniquely prefixes CSS classes like so:

.msg3694196378948278081 .m_3694196378948278081a6S {
  display: none!important;
  opacity: 0.01!important
}

If this is true and we can't target Gmail, this CSS never gets applied and can be removed. Let's test that theory and remove what we can.

Upon retesting this, Gmail still uses a lot of this CSS 🤯 When I removed the CSS to hide the download button for large image, the image reappeared. Gmail is still using .a6S.

Leaving this CSS in place for now.