From cead0f42e044fbd6aa60df394506eaea0382470d Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Mon, 4 May 2026 23:36:03 +0800 Subject: [PATCH] compat(css): fixed table layout and style in dark mode (#4055) Closes #4028 Closes #4029 --- apps/readest-app/src/utils/style.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/readest-app/src/utils/style.ts b/apps/readest-app/src/utils/style.ts index e9ceffa2..7a84bcfb 100644 --- a/apps/readest-app/src/utils/style.ts +++ b/apps/readest-app/src/utils/style.ts @@ -196,6 +196,10 @@ const getColorStyles = ( table:has(> colgroup) { table-layout: fixed; } + td, th { + word-break: break-word; + overflow-wrap: anywhere; + } /* code */ body.theme-dark code { ${isDarkMode ? `color: ${fg}cc;` : ''} @@ -206,8 +210,8 @@ const getColorStyles = ( ${isDarkMode ? `background: color-mix(in srgb, ${bg} 80%, #000);` : ''} } blockquote, table * { - ${isDarkMode && overrideColor ? `background: color-mix(in srgb, ${bg} 80%, #000);` : ''} - ${isDarkMode && overrideColor ? `background-color: color-mix(in srgb, ${bg} 80%, #000);` : ''} + ${isDarkMode ? `background: color-mix(in srgb, ${bg} 80%, #000);` : ''} + ${isDarkMode ? `background-color: color-mix(in srgb, ${bg} 80%, #000);` : ''} } /* override inline hardcoded text color */ font[color="#000000"], font[color="#000"], font[color="black"],