Skip to content

Commit 400fa75

Browse files
committed
Add dark mode support to email templates
1 parent 748adea commit 400fa75

File tree

1 file changed

+85
-2
lines changed

1 file changed

+85
-2
lines changed

src/Illuminate/Mail/resources/views/html/layout.blade.php

Lines changed: 85 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,92 @@
44
<title>{{ config('app.name') }}</title>
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
7-
<meta name="color-scheme" content="light">
8-
<meta name="supported-color-schemes" content="light">
7+
<meta name="color-scheme" content="light dark">
8+
<meta name="supported-color-schemes" content="light dark">
99
<style>
10+
@media (prefers-color-scheme: dark) {
11+
body,
12+
.wrapper,
13+
.body {
14+
background-color: #18181b !important;
15+
}
16+
17+
.inner-body {
18+
background-color: #27272a !important;
19+
border-color: #3f3f46 !important;
20+
}
21+
22+
p,
23+
ul,
24+
ol,
25+
blockquote,
26+
span,
27+
td {
28+
color: #e4e4e7 !important;
29+
}
30+
31+
a {
32+
color: #a5b4fc !important;
33+
}
34+
35+
h1,
36+
h2,
37+
h3,
38+
.header a {
39+
color: #fafafa !important;
40+
}
41+
42+
.logo {
43+
filter: invert(23%) sepia(5%) saturate(531%) hue-rotate(202deg) brightness(96%) contrast(91%) !important;
44+
}
45+
46+
.button-primary,
47+
.button-blue {
48+
background-color: #fafafa !important;
49+
border-color: #fafafa !important;
50+
color: #18181b !important;
51+
}
52+
53+
.button-success,
54+
.button-green {
55+
background-color: #22c55e !important;
56+
border-color: #22c55e !important;
57+
color: #fff !important;
58+
}
59+
60+
.button-error,
61+
.button-red {
62+
background-color: #ef4444 !important;
63+
border-color: #ef4444 !important;
64+
color: #fff !important;
65+
}
66+
67+
.footer p,
68+
.footer a {
69+
color: #71717a !important;
70+
}
71+
72+
.panel-content {
73+
background-color: #3f3f46 !important;
74+
}
75+
76+
.panel-content p {
77+
color: #e4e4e7 !important;
78+
}
79+
80+
.panel {
81+
border-color: #fff !important;
82+
}
83+
84+
.subcopy {
85+
border-top-color: #3f3f46 !important;
86+
}
87+
88+
.table th {
89+
border-bottom-color: #3f3f46 !important;
90+
}
91+
}
92+
1093
@media only screen and (max-width: 600px) {
1194
.inner-body {
1295
width: 100% !important;

0 commit comments

Comments
 (0)