Skip to content

Commit fef6913

Browse files
committed
[fix] Force light color scheme in email #490
Some email clients automatically force dark mode on email content,making the logo invisible. Added color-scheme meta tag and CSS property to explicity force a light color scheme. Removed the invalid supported-color-schemes meta tag and CSS property , keeping only the standard color-scheme. Fixes #490
1 parent 918944a commit fef6913

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

openwisp_utils/admin_theme/templates/openwisp_utils/email_template.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@
55
<head>
66
<meta charset="UTF-8">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<meta name="color-scheme" content="light only">
89
{% block styles %}
910
<style>
11+
:root {
12+
color-scheme: light only;
13+
}
14+
1015
body {
1116
min-width: 250px;
1217
background: #fff;
@@ -74,6 +79,9 @@
7479

7580
.logo-container {
7681
text-align: center;
82+
background-color: #ffffff;
83+
padding: 8px;
84+
border-radius: 8px;
7785
}
7886

7987
.logo {
@@ -186,6 +194,11 @@
186194
margin: 0.5rem auto 0.875rem auto;
187195
}
188196
}
197+
198+
[data-ogsc] .logo-container,
199+
[data-ogsb] .logo-container {
200+
background-color: #ffffff !important;
201+
}
189202
</style>
190203
{% endblock styles %}
191204
</head>

0 commit comments

Comments
 (0)