diff --git a/src/client/accounts/accounts-signature-web-view.vala b/src/client/accounts/accounts-signature-web-view.vala index d424dd642af8a19d0d9906498b8e75ddd43e64d0..aa1c3ae8aab17ad22cafee5eb3ca12ba983c870b 100644 --- a/src/client/accounts/accounts-signature-web-view.vala +++ b/src/client/accounts/accounts-signature-web-view.vala @@ -12,18 +12,23 @@ public class Accounts.SignatureWebView : Components.WebView { private static WebKit.UserScript? app_script = null; + private static WebKit.UserStyleSheet? app_stylesheet = null; public static new void load_resources() throws GLib.Error { SignatureWebView.app_script = Components.WebView.load_app_script( "signature-web-view.js" ); + SignatureWebView.app_stylesheet = Components.WebView.load_app_stylesheet( + "signature-web-view.css" + ); } public SignatureWebView(Application.Configuration config) { base(config); this.user_content_manager.add_script(SignatureWebView.app_script); + this.user_content_manager.add_style_sheet(SignatureWebView.app_stylesheet); } } diff --git a/ui/composer-web-view.css b/ui/composer-web-view.css index 462d5876bdf2ca0e27fc5cf2fd9f0fa8fdcdb375..6ea2caefef4d047c2f3ea2b2d56cb89fcc6a76f3 100644 --- a/ui/composer-web-view.css +++ b/ui/composer-web-view.css @@ -3,21 +3,27 @@ * Copyright 2017 Michael Gratton */ +:root { + /* Adjust default controls and system colors for light and dark mode. + See https://www.w3.org/TR/css-color-adjust-1/#color-scheme-effect */ + color-scheme: light dark; + + /* Apply canvas background to the root element, so body can darken + it using alpha. */ + background-color: canvas; +} + body { + background-color: rgb(50% 50% 50% / .05); + margin: 0 !important; border: 0 !important; padding: 0 !important; - color: black; - background-color: #f9f9f9; font-size: medium !important; } -body.plain, body.plain * { - font-family: monospace !important; - font-weight: normal; - font-style: normal; - font-size: medium !important; - color: black !important; +body.plain { + font-family: monospace; text-decoration: none; } @@ -44,7 +50,7 @@ body > div#geary-quote { } body > div:focus-within { - background-color: white; + background-color: canvas; } body > div#geary-signature:focus-within, diff --git a/ui/conversation-web-view.css b/ui/conversation-web-view.css index d1da2eae5385877e5c3c6e78a24d90b4483cdd43..ed5bcdb9905416ca32200bf94e0dc012196bbe75 100644 --- a/ui/conversation-web-view.css +++ b/ui/conversation-web-view.css @@ -13,9 +13,10 @@ transition: height 0.25s !important; } -html { - color: black; - background-color: white; +:root { + /* Adjust default controls and system colors for light and dark mode. + See https://www.w3.org/TR/css-color-adjust-1/#color-scheme-effect */ + color-scheme: light dark; /* Width must always be defined by the viewport so content doesn't overflow inside the WebView, height must always be defined by the diff --git a/ui/org.gnome.Geary.gresource.xml b/ui/org.gnome.Geary.gresource.xml index 3e314b92c3c397edb701a1482f810bd66a242578..1f9ef0ca6dc5f027768e3abb61e3ffa2ab661949 100644 --- a/ui/org.gnome.Geary.gresource.xml +++ b/ui/org.gnome.Geary.gresource.xml @@ -49,6 +49,7 @@ gtk/help-overlay.ui password-dialog.glade problem-details-dialog.ui + signature-web-view.css signature-web-view.js geary.css single-key-shortcuts.css diff --git a/ui/signature-web-view.css b/ui/signature-web-view.css new file mode 100644 index 0000000000000000000000000000000000000000..538138875e9736685714ec4f87b4982300e0eebf --- /dev/null +++ b/ui/signature-web-view.css @@ -0,0 +1,5 @@ +:root { + /* Adjust default controls and system colors for light and dark mode. + See https://www.w3.org/TR/css-color-adjust-1/#color-scheme-effect */ + color-scheme: light dark; +}