Files
firezone/elixir/apps/domain/priv/static/emails/dark_mode.css
Mariusz Klochowicz a27676a903 fix(portal): support dark mode in outbound emails (#10493)
Ensure that users with dark mode enabled system-wide get nice experience
whilst reading the emails.

Add a `mix test_emails` task to send all the emails and quickly inspect
them locally.

Before:

<img width="767" height="924" alt="image"
src="https://github.com/user-attachments/assets/aaac75bd-67ad-4fd8-82e8-6726ffea6bae"
/>


After (viewed via `mix test_emails`):

<img width="1063" height="928" alt="image"
src="https://github.com/user-attachments/assets/57d3a4d9-5b8f-4a45-8546-7615e15422d8"
/>

---------

Signed-off-by: Mariusz Klochowicz <mariusz@klochowicz.com>
Co-authored-by: Brian Manifold <bmanifold@users.noreply.github.com>
2025-10-16 19:35:36 +00:00

60 lines
1.2 KiB
CSS

@media (prefers-color-scheme: dark) {
body {
background-color: #1a1a1a !important;
}
.email-container {
background-color: #1a1a1a !important;
}
.content-box {
background-color: #2d2d2d !important;
color: #e5e5e5 !important;
}
.content-box h1,
.content-box h2 {
color: #ffffff !important;
}
.content-box p,
.content-box td {
color: #e5e5e5 !important;
}
.content-box th {
color: #d4d4d4 !important;
}
.content-box table tr {
background-color: #2d2d2d !important;
}
.content-box code {
background-color: #1a1a1a !important;
border-color: #525252 !important;
color: #e5e5e5 !important;
}
.content-box pre {
background-color: #1a1a1a !important;
color: #e5e5e5 !important;
}
.separator {
background-color: #525252 !important;
}
.footer-text {
color: #a3a3a3 !important;
}
.footer-text a {
color: #a78bfa !important;
}
.logo-light {
display: none !important;
max-height: 0 !important;
overflow: hidden !important;
}
.logo-dark {
display: inline-block !important;
}
}
@media (prefers-color-scheme: light) {
.logo-dark {
display: none !important;
max-height: 0 !important;
overflow: hidden !important;
}
}