如何防止iOS 13黑暗模式破坏电子邮件 [英] How to prevent iOS 13 Dark Mode from breaking emails

查看:135
本文介绍了如何防止iOS 13黑暗模式破坏电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个电子商务应用程序,当您进行购买时,该应用程序会发送订单详细信息,而我们只是重新设计了该电子邮件模板.在过去几天中,我们收到了一些客户报告,其中电子邮件中的一半文本丢失了.

最终获得了屏幕截图后,我们了解到问题是在使用暗模式的iPhone上发生的.到目前为止,他们都是通过Mail应用程序或Safari使用gmail的客户(两者都有相同的问题).我不确定gmail因素是否相关或偶然.

我们的电子邮件很简单-背景为白色,标题为灰色,正文为黑色.深色模式使白色背景和灰色标题保持不变,但是正文文本从黑色更改为白色.在白色背景上,白色文本显然是不可见的,并且电子邮件看起来缺少大量内容.

有什么办法可以防止黑暗模式将我们的文本从黑色变成白色?

我应该注意,我们的电子邮件中还嵌入了QR码,因此我担心的解决方案将使深色模式继续为我们的完整电子邮件重新着色,因为我认为这会使QR码更难处理被认可.

这与任何应用程序代码均无关,因此,不适用针对黑暗模式开发iOS的准则.这仅仅是有关iOS 13上处于黑暗模式的Apple邮件应用如何显示HTML电子邮件的问题.

解决方案

感谢@FrankSchlegel提供的链接

https://webkit.org/blog/8840/dark-mode-support-in-webkit/

答案是在所有元素的css中使用.谢谢!

We have an e-commerce app that sends out order details when a purchase is made, and we just redesigned that email template. We've received reports over the past few days of some customers having half the text in the email missing.

After finally getting a screenshot, we've learned that the issue is happening on iPhones using dark mode. So far they've all been customers using gmail with either the Mail app or with Safari (both have the same problem). I'm not sure if the gmail factor is relevant or a coincidence.

Our email is simple -- it has a white background, gray headings, and black body text. Dark mode is leaving the white background and gray headings untouched, but the body text is being changed from black to white. On the white background, the white text is obviously invisible, and the email looks like it's missing large amounts of content.

Is there anything that can be done to prevent dark mode from changing our text from black to white?

I should note that we also have a QR code embedded in the email, so I'm concerned about solutions that would allow dark mode to proceed in recoloring our full email, as I believe it would make it harder for the QR code to be recognized.

Edit: this is not related to any app code, so guidelines on developing iOS for dark mode don't apply. This is simply an issue of how Apple's Mail app on iOS 13 in dark mode is displaying an HTML email.

解决方案

Thanks to the link provided by @FrankSchlegel

https://webkit.org/blog/8840/dark-mode-support-in-webkit/

using color-scheme: light only in the css on all elements was the answer. Thank you!

这篇关于如何防止iOS 13黑暗模式破坏电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆