From 1c55516ca84785ac1551e1de0f50667d67eca9db Mon Sep 17 00:00:00 2001 From: Duncan Lock Date: Thu, 14 Jul 2022 13:44:39 -0700 Subject: [PATCH 1/3] Better Dark Mode Preset CSS The existing dark mode preset uses a filter to simluate dark mode, which noticably degrades text rendering in Edge/Windows (and possible other places). This replaces that with CSS that just sets element colors , which renders fine on Egde/Windows - and should work everywhere without issues. --- src/popup.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/popup.js b/src/popup.js index b89f389..163c33f 100644 --- a/src/popup.js +++ b/src/popup.js @@ -41,13 +41,20 @@ for (const link of links) { // Custom CSS presets const cssPresets = { darkMode: ` - body { - background-color: black !important; - filter: invert(90%) hue-rotate(180deg) !important; - } - .__rhn__profile-dropdown { - background-color: #f6f6ef !important; - } + html, body, tbody, #pagespace, field, textarea { + background-color: black !important; + color: #fff !important; + } + p, td, .comment, .commtext, a { + color: #fff !important; + } + pre { + background-color: #333 !important; + color: #fff !important; + } + .__rhn__profile-dropdown { + background-color: #f6f6ef !important; + } `, }; From 2b4588517432d439f082037f6afddd7bbeae4865 Mon Sep 17 00:00:00 2001 From: Duncan Lock Date: Thu, 14 Jul 2022 13:54:23 -0700 Subject: [PATCH 2/3] Add hmain class to fix white space at top of page. --- src/popup.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/popup.js b/src/popup.js index 163c33f..92683a6 100644 --- a/src/popup.js +++ b/src/popup.js @@ -41,7 +41,8 @@ for (const link of links) { // Custom CSS presets const cssPresets = { darkMode: ` - html, body, tbody, #pagespace, field, textarea { +/* Preset: darkMode */ + html, body, tbody, #pagespace, field, textarea, #hnmain { background-color: black !important; color: #fff !important; } From 9ba6fd4400d661f6e24aab53643fe867211be093 Mon Sep 17 00:00:00 2001 From: Duncan Lock Date: Thu, 14 Jul 2022 14:00:33 -0700 Subject: [PATCH 3/3] Fix popup menu --- src/popup.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/popup.js b/src/popup.js index 92683a6..5a91095 100644 --- a/src/popup.js +++ b/src/popup.js @@ -42,7 +42,8 @@ for (const link of links) { const cssPresets = { darkMode: ` /* Preset: darkMode */ - html, body, tbody, #pagespace, field, textarea, #hnmain { +/* Preset: darkMode */ + html, body, tbody, #pagespace, field, textarea, #hnmain, span { background-color: black !important; color: #fff !important; } @@ -54,7 +55,7 @@ const cssPresets = { color: #fff !important; } .__rhn__profile-dropdown { - background-color: #f6f6ef !important; + background-color: #666 !important; } `, };