Skip to content

Commit 331b242

Browse files
committed
Add dark mode support to email templates
1 parent 748adea commit 331b242

File tree

1 file changed

+91
-2
lines changed

1 file changed

+91
-2
lines changed

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

Lines changed: 91 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,98 @@
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-secondary {
54+
background-color: #3f3f46 !important;
55+
border-color: #3f3f46 !important;
56+
color: #fafafa !important;
57+
}
58+
59+
.button-success,
60+
.button-green {
61+
background-color: #22c55e !important;
62+
border-color: #22c55e !important;
63+
color: #fff !important;
64+
}
65+
66+
.button-error,
67+
.button-red {
68+
background-color: #ef4444 !important;
69+
border-color: #ef4444 !important;
70+
color: #fff !important;
71+
}
72+
73+
.footer p,
74+
.footer a {
75+
color: #71717a !important;
76+
}
77+
78+
.panel-content {
79+
background-color: #3f3f46 !important;
80+
}
81+
82+
.panel-content p {
83+
color: #e4e4e7 !important;
84+
}
85+
86+
.panel {
87+
border-color: #fff !important;
88+
}
89+
90+
.subcopy {
91+
border-top-color: #3f3f46 !important;
92+
}
93+
94+
.table th {
95+
border-bottom-color: #3f3f46 !important;
96+
}
97+
}
98+
1099
@media only screen and (max-width: 600px) {
11100
.inner-body {
12101
width: 100% !important;

0 commit comments

Comments
 (0)