Live data from Hacker News

Gmail will now support CSS media queries

googleappsdeveloper.blogspot.com

21–30 of 70 posts

Re: Gmail will now support CSS media queries

#21

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

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

Maybe - I think we might see a bifurcation between the Gmail experience for consumers (Inbox) and what they provide as part of Google for Work.

I'm looking for something that resembles GMail's actual functionality that is currently supported by Outlook and a variety of other email clients. I would just prefer a Gmail-native app because the Gmail app works more smoothly with Gmail than Outlook or any other provider does - particularly around search.

Re: Gmail will now support CSS media queries

#22
post #14

I always wish we could go back to plaintext emails.

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.

"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.

Re: Gmail will now support CSS media queries

#24
post #13

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.

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

Re: Gmail will now support CSS media queries

#27
post #10

This is mostly a distraction, but I still wish text/enriched had won instead of HTML email: 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).

Regarding the example in the Wiki page: Is it possible to use hex colors codes or rgb color codes? The example uses color name.

In fact, you have even more options, not just two:

1) RGB: #rrggbb (rgb hex) / rgb(r,g,b) (rgb int 0-255) / rgba(r,g,b,a) (as before, plus alpha). In addition, rgb/rgba support percentage values instead of 0-255.

2) red (color names)

3) hsl(h,s,l)

4) cmyk(c,m,y,k)

For compatibility with anything except Thunderbird (which supports all four formats IIRC), stick with #rrggbb or plaintext names. Webmailers are especially prone to filtering by regex (ugh), and stripping out everything they don't know.

Re: Gmail will now support CSS media queries

#28
post #8
post #2

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

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.c…

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.

Re: Gmail will now support CSS media queries

#29
post #13

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.

You can have a lot of fun placing elements over the web mail client buttons.

Re: Gmail will now support CSS media queries

#30
post #24
post #13

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.

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

Put it in a safe iframe, whats the catch?
Post reply on HN