From c9fc62b621c58b15b5d68bbabfedbe5f6867da08 Mon Sep 17 00:00:00 2001 From: jat Date: Fri, 15 Nov 2024 11:18:58 +0100 Subject: [PATCH] Fix text appearing grey while printing in dark mode It was the caused by the different foreground and background contrast between the light mode and dark mode. This commit forces the light mode foreground and background to be used when printing. --- src/common/gui/main-styles.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/gui/main-styles.ts b/src/common/gui/main-styles.ts index 29a741a1f002..7fc7d635fa71 100644 --- a/src/common/gui/main-styles.ts +++ b/src/common/gui/main-styles.ts @@ -8,6 +8,7 @@ import { getContentButtonIconBackground, getElevatedBackground, getNavigationMen import { stateBgActive, stateBgFocus, stateBgHover, stateBgLike } from "./builtinThemes.js" import { FontIcons } from "./base/icons/FontIcons.js" import { DefaultAnimationTime } from "./animation/Animations.js" +import { locator } from "../api/main/CommonLocator.js" assertMainOrNode() @@ -35,6 +36,7 @@ const searchBarShadow = "0px 2px 4px rgb(0, 0, 0, 0.12)" const scrollbarWidthHeight = px(18) styles.registerStyle("main", () => { + const lightTheme = locator.themeController.getBaseTheme("light") return { "#link-tt": isElectronClient() ? { @@ -2486,6 +2488,8 @@ styles.registerStyle("main", () => { "html, body": { position: "initial", overflow: "visible !important", + color: lightTheme.content_fg, + "background-color": `${lightTheme.content_bg} !important`, }, // overwrite position "fixed" otherwise only one page will be printed. ".header-nav": {