
Gmail will now support CSS media queries - synotic
http://googleappsdeveloper.blogspot.com/2016/09/your-emails-optimized-for-every-screen-with-responsive-design.html
======
TazeTSchnitzel
This is mostly a distraction, but I still wish text/enriched had won instead
of HTML email:
[https://en.wikipedia.org/wiki/Enriched_text](https://en.wikipedia.org/wiki/Enriched_text)

If only because it's simpler, so it might have been more fully and
consistently supported (and it's not a security nightmare).

~~~
wvenable
I was expecting something significantly different from HTML but this is really
just pre-CSS HTML with different tags. At this point, I can't imagine another
SGML based language for formatting is necessary.

If everyone could just agree on a safe subset of HTML for email then that's
all we would need.

~~~
jcranmer
Thunderbird literally implements it by rewriting it into HTML:
[https://dxr.mozilla.org/comm-
central/source/mailnews/mime/sr...](https://dxr.mozilla.org/comm-
central/source/mailnews/mime/src/mimetric.cpp#42)

text/enriched was basically proposed as an interim result for richer text than
plain text back when HTML email was controversial.

There is a more-or-less defunct community group at the W3C about building an
HTML email specification. In practice, the elephant in the room remains
Outlook, which uses the same HTML engine built into MS Word, which, IIRC, is
built on IE 5.5.

------
saurik
The last time this got submitted and ended up with comments is here (though
this is the forth time this has been submitted in as many days).

[https://news.ycombinator.com/item?id=12500838](https://news.ycombinator.com/item?id=12500838)

~~~
tambourine_man
I really dislike this new dedup algorithm.

I feel like I'm reading Hacker Rehashed News

------
tszming
For those who are not familiar in Email's CSS support, Gmail is actually a
blocker, not a mover:
[https://www.campaignmonitor.com/css/](https://www.campaignmonitor.com/css/)

~~~
buro9
You say that like it is a bad thing.

I'm really pleased that email cannot set a style header and has limited
ability to have the email deviate greatly in presentation from other email I
receive.

~~~
amelius
Why not block styling on web pages too then? I mean, what makes an email
different from a web page, other than that it has been sent to you?

Just playing devil's advocate here.

~~~
buro9
> what makes an email different from a web page, other than that it has been
> sent to you?

I think it's to do with perceived ownership of the environment in which the
information is consumed.

 _Your_ website... feel free to style, brand, make pretty or ugly. You can
make the experience consistent within your realm.

 _My_ inbox... I get to control my workflows, how I consume things, in which
order, etc. I choose to make the experience consistent within my realm.

That holds fairly well as a definition for why I prefer chat clients that
grant me the ability to make all messages consistent, and that do not allow
the sender to dictate terms. It also holds up with things like Netflix, it's
their realm they can knock themselves out on their design.

It does seem to be whether the environment it is presented is "yours" or
"mine".

~~~
nailer
It's your client, but the site's content, in both web and email cases.

You are free to set your client to ignore styling on the content, but the
content should be stylable for everyone else that wants it to look good.

------
CM30
It's a good start, and something that's very useful for people coding HTML
emails.

That said, we still need to get this sort of thing in Microsoft Outlook, and
both that and Gmail really need to support CSS to something of a normal
standard, like with say Apple Mail or what not. There's no real reason email
standards should be different to browser ones, except with the former not
having Javascript included.

~~~
haimez
Good luck stopping a browser from implementing a "fun" javascript API just
because it opens a security or usability hole in email.

~~~
networth
Put it in a safe iframe, whats the catch?

~~~
haimez
Everything. iframes can't fuck with you code, but they are 1. displayed in
your page (is this a good idea, does this iframe agree with how your page will
display it). 2. Is leaking information to this iframe (and consequently, that
iframe's server that this email had been opened) a good idea (no. 100% it's
not.). 3. Can someone else contrive another vector of page control or
information leak that suits their motives and hasn't been considered a priori
by you (also yes, 100%. Never underestimate the motivation or creativity of
others).

Never, ever, EVER embed an iframe thinking it will make your life better.

~~~
networth
Are most of these protected by sandboxed iframes? What kind if leak are you
talking about? Referer leak? That is easy to fix, but what else?

I dont think email sender cares about how iframe is rendered. They currently
render in a rectangle, and they will keep render in a rectangle.

------
MereInterest
This is a great thing. One more metric by which to filter out spam. If I am
receiving an email from an actual person, it will be plain text, perhaps with
1-2 links or images, and will not contain any CSS.

~~~
hrayr
A bit passive aggressive don't you think?

There are plenty of reputable email clients that add extra styling to make
email look better that are not necessarily spam.

~~~
userbinator
I filter out HTML emails too, and a lot of mailing lists do as a standard
practice. For some reason I find a large amount of sites which specify precise
expectations for email are either German or somewhere in that region. Here's
two examples:

[https://www.gaertner.de/~neitzel/mail-
policy.html](https://www.gaertner.de/~neitzel/mail-policy.html)

[https://www-user.tu-chemnitz.de/~heha/email.var](https://www-user.tu-
chemnitz.de/~heha/email.var)

The prevailing attitude seems to be "If you can't configure your email client
to send plaintext or follow the other rules I've listed on my site, I'm not
interested in communicating with you."

------
jeena
I always wish we could go back to plaintext emails.

~~~
Alex3917
Pretty much every single html email also has a plaintext version attached,
otherwise it hurts the deliverability. You just need to set your email client
to use the plaintext version.

~~~
tedunangst
"Your client does not support HTML."

Yeah, thanks. I'm doubly ecstatic when the unsubscribe link is in the HTML
version and not the text version.

------
robryan
That is great. We use emarsys for marketing emails which extensively uses
media queries to build a mobile specific version of your template.

The example they give with a YouTube email. I wonder if they decided to make
the change because of internal pressure from those sending out marketing
emails.

------
ykler
Does anyone know why it took them so long to do this?

~~~
cpmsmith
They've historically been very restrictive about what they do and don't allow
in emails—iirc, they even stripped CSS blocks entirely until recently. Even
now they only accept a specific list of properties, selectors, and queries.[1]
My impression is it's broadly in the name of security: if you allow arbitrary
content inside a Google webpage, it's easy to imagine phishing running amok.

[1]:
[https://developers.google.com/gmail/design/css](https://developers.google.com/gmail/design/css)

~~~
mschuster91
The solution is very simple actually: place user-generated content like emails
inside an iframe, after stripping out the JS. Add a CSP header disallowing
external resource loads until the user confirms explicitly.

This way, content using position:absolute can't escape the iframe borders, and
the mail gets to enjoy full responsiveness.

~~~
packetslave
a gentle hint: if you find yourself writing "the solution is very simple" and
you're talking about something at the scale of gmail (or Firefox, or AWS, or
Linux, or...), you can probably be assured there are a few things you haven't
considered.

------
nsfmc
although this was announced on friday, it has yet to be enabled (at least on
test emails i've been developing). I'm not sure why it was announced without
the feature being generally available, but i guess whenever they flip the
switch, old emails will be upgraded to use the style tags embedded in them?

Even without media queries, enabling <style> blocks in html emails is huge
(google was the last holdout). For anyone developing html emails, this is a
nice set of changes.

------
tscs37
Personally, I'd love if Gmail would support markdown or retext.

I don't need any of this fancy.

------
inthewoods
I would just love to see an update to the Gmail app on iOS - very far behind
Outlook imho.

~~~
agildehaus
I don't know what you're looking for in an email client, but Gmail's future is
the Inbox app.

~~~
swiley
I tried inbox for a while, it tries to be too intelligent and I ended up
missing important stuff because of it.

~~~
cmg
Agreed, I had the same experience. I might be waiting for a password reset or
shipping email, or something on a mailing list, and with Inbox it was more of
a guessing game.

I've gone back to using standard Gmail but added the Inbox Categories, which I
find to be very useful on top of the labels & filters I have in place.

------
mschuster91
Whoa! That's awesome. Now, if all the other webmailers would follow suit...

------
drannex
Welcome to 2011!

------
dang
Url changed from [https://gmail.googleblog.com/2016/09/better-emails-
tailored-...](https://gmail.googleblog.com/2016/09/better-emails-tailored-to-
all-your-devices.html), which points to this, which is more specific.

