Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Enable dark mode for mail notifications

Inga Maif15c63885b6b
diff --git a/app/views/layouts/project_mailer.html.erb b/app/views/layouts/project_mailer.html.erb
index d679ea37bc3..1fd42c6fe39 100644
--- a/app/views/layouts/project_mailer.html.erb
+++ b/app/views/layouts/project_mailer.html.erb
@@ -27,46 +27,51 @@ See docs/COPYRIGHT.rdoc for more details.
++#%>
<html>
-<head>
- <style>
- body {
- font-family: Verdana, sans-serif;
- font-size: 0.8em;
- color: #484848;
- background: #FFFFFF;
- }
+ <head>
+ <style>
+ :root {
+ color-scheme: light dark;
+ supported-color-schemes: light dark;
+ }
- @media (prefers-color-scheme: dark) {
body {
- color: #CCC;
- background: #222222;
+ font-family: Verdana, sans-serif;
+ font-size: 0.8em;
+ color: #484848;
+ background: #FFFFFF;
+ }
+
+ @media (prefers-color-scheme: dark) {
+ body {
+ color: #CCC !important;
+ background: #222222 !important;
+ }
}
- }
- h1, h2, h3 { font-family: "Trebuchet MS", Verdana, sans-serif; margin: 0px; }
- h1 { font-size: 1.2em; }
- h2, h3 { font-size: 1.1em; }
- a, a:link, a:visited { color: #2A5685;}
- a:hover, a:active { color: #c61a1a; }
- a.wiki-anchor { display: none; }
- hr {
- width: 100%;
- height: 1px;
- background: #ccc;
- border: 0;
- }
- .footer {
- font-size: 0.8em;
- font-style: italic;
- }
- </style>
-</head>
-<body>
-<span class="header"><%= OpenProject::TextFormatting::Renderer.format_text(Setting.localized_emails_header) %></span>
-<%= call_hook(:view_layouts_mailer_html_before_content, self.assigns) %>
-<%= yield %>
-<%= call_hook(:view_layouts_mailer_html_after_content, self.assigns) %>
-<hr />
-<span class="footer"><%= OpenProject::TextFormatting::Renderer.format_text(Setting.localized_emails_footer) %></span>
-</body>
+ h1, h2, h3 { font-family: "Trebuchet MS", Verdana, sans-serif; margin: 0px; }
+ h1 { font-size: 1.2em; }
+ h2, h3 { font-size: 1.1em; }
+ a, a:link, a:visited { color: #2A5685;}
+ a:hover, a:active { color: #c61a1a; }
+ a.wiki-anchor { display: none; }
+ hr {
+ width: 100%;
+ height: 1px;
+ background: #ccc;
+ border: 0;
+ }
+ .footer {
+ font-size: 0.8em;
+ font-style: italic;
+ }
+ </style>
+ </head>
+ <body>
+ <span class="header"><%= OpenProject::TextFormatting::Renderer.format_text(Setting.localized_emails_header) %></span>
+ <%= call_hook(:view_layouts_mailer_html_before_content, self.assigns) %>
+ <%= yield %>
+ <%= call_hook(:view_layouts_mailer_html_after_content, self.assigns) %>
+ <hr />
+ <span class="footer"><%= OpenProject::TextFormatting::Renderer.format_text(Setting.localized_emails_footer) %></span>
+ </body>
</html>
diff --git a/app/views/layouts/user_mailer.html.erb b/app/views/layouts/user_mailer.html.erb
index 5512867d093..a0421cfc76a 100644
--- a/app/views/layouts/user_mailer.html.erb
+++ b/app/views/layouts/user_mailer.html.erb
@@ -29,6 +29,11 @@ See docs/COPYRIGHT.rdoc for more details.
<html>
<head>
<style>
+ :root {
+ color-scheme: light dark;
+ supported-color-schemes: light dark;
+ }
+
body {
font-family: Verdana, sans-serif;
font-size: 0.8em;
@@ -38,8 +43,8 @@ See docs/COPYRIGHT.rdoc for more details.
@media (prefers-color-scheme: dark) {
body {
- color: #CCC;
- background: #222222;
+ color: #CCC !important;
+ background: #222222 !important;
}
}