litmus ®
Everything You Need to Know About
GMAILRENDERING
@KevinMandeville #CSSSummit
HELLO,I’M@KEVINMANDEVILLE
@KevinMandeville #CSSSummit
IDESIGN+BUILDEMAILSAT
litmus ®
#LitmusLive
TWEET
@litmusapp #LitmusLive
WITHANYQUESTIONS
litmus ®
#LitmusLive
emailclientmarketshare.com
Source: Litmus Email Analytics
litmus ®
#LitmusLive
26%of market share is Gmail
Source: Litmus Email Analytics
litmus ®
#LitmusLive
WENEED(ED)INLINESTYLES
BECAUSEGMAIL...
B.C(SS).
GMAILRENDERING
Source:https://emails.hteumeuleu.com/trying-to-make-sense-of-gmail-css-support-after-the-2016-update-53c15151063a
#LitmusLive
❌ WITHOUTINLINECSS ✅ WITHINLINECSS
#LitmusLive
✅ WITHINLINECSS❌ WITHOUTINLINECSS
🎉GMAILNOWSUPPORTS 🎉
EMBEDDEDCSS+MEDIAQUERIES!!!
😍
😍
😍
😍
https://blog.google/products/gmail/better-emails-tailored-to-all-your-devices | https://litmus.com/blog/gmail-to-support-responsive-email-design
AFTER
GMAILRENDERING
Source:https://emails.hteumeuleu.com/trying-to-make-sense-of-gmail-css-support-after-the-2016-update-53c15151063a
litmus ®
#LitmusLive
Desktop webmail ✅
Mobile webmail ❌
Gmail Android App (Gmail Account) ✅
Gmail Android App (Gmailified Account) ✅
Gmail Android App (POP/IMAP Account) ❌
Gmail iOS App ✅
Inbox by Gmail webmail ✅
Inbox by Gmail iOS App ✅
Inbox by Gmail Android App ✅
G Suite (formerly Google Apps) ✅
Google Apps Free Edition (legacy) ❌
EMBEDDEDCSS+MEDIAQUERYSUPPORTINGMAIL
(*EXTERNALCSSSTILLNOTSUPPORTED)
litmus ®
#LitmusLive
Android 4.4 (Vanilla Stock Email App) ✅
Android 5.1 (Vanilla Stock Email App) ❌
Android 6.0 (Vanilla Stock Email App) ❌
Gmail Android App (Gmail Account) ✅
Gmail Android App (Gmailified Account) ✅
Gmail Android App (POP/IMAP Account) ❌
EMBEDDEDCSS+MEDIAQUERYSUPPORTONANDROID
litmus ®
#LitmusLive
ANDROID4.4 ANDROID5.1 ANDROID6.0
DEFAULTANDROIDEMAILAPPS
Android 5.1+ switched to Gmail app as the default email app.
The stock vanilla email app on Android OS does not currently
exist in the wild, though remains publicly available for
developers to use and build off of. The stock vanilla email app
on Android OS on 5.1+ does not support embedded CSS.
Stock vanilla email app of
Android OS (supports
embedded CSS)
litmus ®
Highlights of the
RENDERINGUPDATE
litmus ®
#LitmusLive
75%of market share now supports responsive email - no excuses anymore!
Source: Litmus Email Analytics
@KevinMandeville #CSSSummit
✅ SUPPORTEDMEDIAQUERIES
Types:
all
screen
Keywords:
and
only
Queries:
min-width
max-width
min-device-width
max-device-width
orientation
min-resolution
max-resolution
@KevinMandeville #CSSSummit
✅ BACKGROUNDIMPROVEMENTS
background
background-blend-mode
background-clip
background-color
background-image
background-origin
background-position
background-repeat
background-size
@KevinMandeville #CSSSummit
✅ ACCESSIBILITYCSSIMPROVEMENTS
pitch
pitch-range
richness
speak
speak-header
speak-numeral
speak-punctuation
speech-rate
@KevinMandeville #CSSSummit
✅ :hover
❌ :checked
(GOODBYECSSCLICKEVENTS+INTERACTIVEEMAILINGMAIL)
@KevinMandeville #CSSSummit
ITEMSSTILLNOTSUPPORTED...
❌ External stylesheets
❌ Absolute/fixed positioning
❌ Negative margins
❌ CSS animations
❌ Web fonts
❌ HTML5 video
litmus ®
COMMONERRORSTOAVOID...
AREYOUNOTSEEINGGMAILRENDERYOURCSS?
litmus ®
#LitmusLive
DOESYOURVERSIONORACCOUNTOF
GMAILSUPPORTEMBEDDEDCSS?
#1
litmus ®
#LitmusLive
Desktop webmail ✅
Mobile webmail ❌
Gmail Android App (Gmail Account) ✅
Gmail Android App (Gmailified Account) ✅
Gmail Android App (POP/IMAP Account) ❌
Gmail iOS App ✅
Inbox by Gmail webmail ✅
Inbox by Gmail iOS App ✅
Inbox by Gmail Android App ✅
G Suite (formerly Google Apps) ✅
Google Apps Free Edition (legacy) ❌
EMBEDDEDCSS+MEDIAQUERYSUPPORTINGMAIL
(*EXTERNALCSSSTILLNOTSUPPORTED)
litmus ®
#LitmusLive
Android 4.4 (Vanilla Stock Email App) ✅
Android 5.1 (Vanilla Stock Email App) ❌
Android 6.0 (Vanilla Stock Email App) ❌
Gmail Android App (Gmail Account) ✅
Gmail Android App (Gmailified Account) ✅
Gmail Android App (POP/IMAP Account) ❌
EMBEDDEDCSS+MEDIAQUERYSUPPORTONANDROID
litmus ®
#LitmusLive
✅ GMAILANDROIDAPP(GMAILACCOUNT) ❌ GMAILANDROIDAPP(POP/IMAPACCOUNT)
litmus ®
#LitmusLive
POP/IMAPACCOUNTS=NON-GMAILACCOUNTS
(i.e.@aol.com,@outlook.com,@yahoo.com)
~EMAILTHATLIVESOUTSIDEOFGMAIL’SSERVERS~
litmus ®
#LitmusLive
HOWTOIDENTIFYYOURPOP/IMAPAUDIENCE
1. Use email analytics
2. Choose representative sample of campaigns to
analyze based on your audience size
3. Select all opens from Gmail clients
4. Calculate number of non-Gmail addresses used to
ballpark total and percentage of POP/IMAP audience
https://blog.google/products/gmail/gmailify-best-of-gmail-without-gmail
GMAILIFYYOURNON-GMAILEMAILACCOUNTS
TOGETRENDERINGUPDATE
litmus ®
#LitmusLive
GMAILANDROIDAPP(POP/IMAP
ACCOUNT)DOESNOTSUPPORT
BACKGROUNDIMAGESATALL
❌
litmus ®
#LitmusLive
ISYOURCSS“INVALID”?
#2
(ACCORDINGTOGMAIL)
litmus ®
#LitmusLive
GMAILWILLSTRIPANYCSSTHATIS
INVALIDORITDEEMSINVALID
@KevinMandeville #CSSSummit
❌ td[class=“foo”] { }
✅ .foo { }
DONOTUSEATTRIBUTESELECTORS
@KevinMandeville #CSSSummit
@media {
@font-face { }
}
DONOTNESTCSS@DECLARATIONS
❌
@KevinMandeville #CSSSummit
=, *, /, $, %, , &, @,
^, {, }, [, ], (, ), ?,
|, <, >
DONOTUSETHESECHARACTERSINYOURCSS
@KevinMandeville #CSSSummit
VALIDATEYOURCSSUSINGW3C
https://jigsaw.w3.org/css-validator/
litmus ®
#LitmusLive
SIMPLYPLACEANY“INVALID”GMAIL
CSSINTHEIROWNSTYLEBLOCKS
@KevinMandeville #CSSSummit
<style>
.foo {
width: 50%;
}
@media screen and (-webkit-min-device-
pixel-ratio: 0) {
.foo { width: 100%; }
}
</style>
❌ GMAILWILLSTRIPTHISENTIRESTYLEBLOCK
“Invalid” to Gmail
@KevinMandeville #CSSSummit
<style>
.foo {
width: 50%;
}
</style>
<style>
@media screen and (-webkit-min-device-pixel-
ratio: 0) {
.foo { width: 100%; }
}
</style>
✅ GMAILWILLONLYSTRIPTHE2NDSTYLEBLOCK
“Invalid” to Gmail
✅
❌
litmus ®
#LitmusLive
AREYOUOVERGMAIL’S
8142CSSCHARACTERLIMIT?
#3
(THISCOUNTSALLSTYLEBLOCKS)
litmus ®
#LitmusLive
GMAILWILLSTRIPALLCSSSTYLEBLOCKS
ONCEITSURPASSES8142CHARACTERS
litmus ®
#LitmusLive
USECSSMINIFIERSTO
COMPRESSYOURCSS
(ORDOITBYHAND)
litmus ®
#LitmusLive
WEREIMAGESOFFBYDEFAULT&
THENTURNEDON?
#4
@KevinMandeville #CSSSummit
<style>
.foo { background: #333333; }
</style>
<p class="foo">
Lorem ipsum dolor sit amet, consectetur
adipisicing elit.
</p>
<img src="spacer.gif" alt="This image is
blocked." />
RAWMARKUP
Source:https://emails.hteumeuleu.com/troubleshooting-gmails-responsive-design-support-ad124178bf81
@KevinMandeville #CSSSummit
<div class="m159215f7d36ee7fd">
<style>
div.m159215f7d36ee7fd .m_3567455155959655244
foo { background: #333333; }
</style>
<p class="m_3567455155959655244foo">
Lorem ipsum dolor sit amet, consectetur
adipisicing elit.
</p>
<img alt="This image is blocked." />
</div>
PROCESSEDMARKUPWHENIMAGESAREBLOCKED...
Source:https://emails.hteumeuleu.com/troubleshooting-gmails-responsive-design-support-ad124178bf81
@KevinMandeville #CSSSummit
<div class="m159215f7d36ee7fd">
<style>
div.m159215f7d36ee7fd .m_3567455155959655244
foo { background: #333333; }
</style>
<p class="m_-8249599400804587256foo">
Lorem ipsum dolor sit amet, consectetur
adipisicing elit.
</p>
<img alt="This image is blocked." />
</div>
PROCESSEDMARKUPWHENIMAGESAREDOWNLOADED...
Source:https://emails.hteumeuleu.com/troubleshooting-gmails-responsive-design-support-ad124178bf81
@KevinMandeville #CSSSummit
<div class="m159215f7d36ee7fd">
<style>
div.m159215f7d36ee7fd .m_3567455155959655244
foo { background: #333333; }
</style>
<p class="m_-8249599400804587256foo">
Lorem ipsum dolor sit amet, consectetur
adipisicing elit.
</p>
<img alt="This image is blocked." />
</div>
CURRENTBUGWHERECLASSESCHANGEWHENIMAGESAREDOWNLOADED
Source:https://emails.hteumeuleu.com/troubleshooting-gmails-responsive-design-support-ad124178bf81
litmus ®
Some more
GMAILQUIRKS...
litmus ®
#LitmusLive
GMAILiOSAPPADDSSPACING
TORIGHT-HANDSIDEOFEMAIL
@KevinMandeville #CSSSummit
FORCEGMAILiOSTOFULL-WIDTH
CSS
.body {
min-width: 100vw;
}
HTML
<body class=“body”></body>
(*THISWILLIMPACTGMAILANDROIDPOP/IMAPVIEW)
@KevinMandeville #CSSSummit
FORCEADESKTOPVIEWONGMAILANDROIDPOP/IMAP
CSS
.gmailfix {
display: none;
display: none !important;
}
HTML
<div class="gmailfix" style=“white-space: nowrap; font:
15px courier; line-height: 0;">&nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;</div>
litmus ®
#LitmusLive
GMAILCLIPSYOUREMAILAT102KB
(HTMLFILESIZE,NOTIMAGES)
@KevinMandeville #CSSSummit
USEHTMLMINIFIERSTOCOMPRESSYOURHTML
https://kangax.github.io/html-minifier/
(ORDOITBYHAND)
litmus ®
#LitmusLive
GMAILDISPLAYSDOWNLOADICON
FORANYUNLINKEDIMAGE
(TYPICALLYABOVE250x250DIMENSIONS)
@KevinMandeville #CSSSummit
<a href="http://litmus.com">
<img src="logo.jpg">
</a>
LINKIMAGESTOREMOVEDOWNLOADICON
litmus ®
How to
TARGETGMAIL
🎯
@KevinMandeville #CSSSummit
TARGETINGGMAIL+INBOXBYGMAIL
CSS
u ~ div .gmail {
/* Insert CSS here */
}
HTML
<div class=“gmail”></div>
@KevinMandeville #CSSSummit
TARGETINGGMAIL
CSS
u + .body section .gmail {
/* Insert CSS here */
}
HTML
<body class=“body”>
<section>
<div class=“gmail”></div>
</section>
</body>
@KevinMandeville #CSSSummit
TARGETINGINBOXBYGMAIL
CSS
u + .body > .inbox {
/* Insert CSS here */
}
HTML
<body class=“body”>
<section>
<div class=“inbox”></div>
</section>
</body>
litmus ®
Do we still need to
INLINEOURCSS?
litmus ®
#LitmusLive
99%of market share now supports embedded CSS
Source: Litmus Email Analytics
@KevinMandeville #CSSSummit
https://litmus.com/community/discussions/6116-here-s-why-litmus-didn-t-inline-css-for-its-first-newsletter-of-2017
LITMUSDIDN’TINLINECSSFORITSFIRSTNEWSLETTEROF2017
litmus ®
How important is
HYBRIDORFABFOURNOW?
litmus ®
RESOURCES
litmus ®
#LitmusLive
https://litmus.com/blog/gmail-to-support-responsive-email-design
litmus ®
#LitmusLive
https://litmus.com/blog/the-ultimate-guide-to-email-on-android
litmus ®
#LitmusLive
https://litmus.com/blog/3-keys-to-understanding-email-rendering-on-android
litmus ®
#LitmusLive
https://emails.hteumeuleu.com/troubleshooting-gmails-responsive-design-support-ad124178bf81
litmus ®
#LitmusLive
litmus.com/community
litmus ®
#LitmusLive
litmus.com/scope
litmus ®
#LitmusLive
litmus.com
litmus ®
Q&A

Everything You Need to Know About Gmail Rendering