From 988fbc8c858a16f56708b7caf6c6cb84a261fe4e Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Sun, 28 Dec 2025 18:02:56 +0100 Subject: [PATCH] fix(settings): override book text align of left (#2802) --- apps/readest-app/src/utils/style.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/readest-app/src/utils/style.ts b/apps/readest-app/src/utils/style.ts index 0b5c87c7..4e4ee1f2 100644 --- a/apps/readest-app/src/utils/style.ts +++ b/apps/readest-app/src/utils/style.ts @@ -284,6 +284,10 @@ const getLayoutStyles = ( dd.aligned-center, div.aligned-center { text-align: center ${overrideLayout ? '!important' : ''}; } + p.aligned-left, blockquote.aligned-left, + dd.aligned-left, div.aligned-left { + ${justify && overrideLayout ? 'text-align: justify !important;' : ''} + } p.aligned-right, blockquote.aligned-right, dd.aligned-right, div.aligned-right { text-align: right ${overrideLayout ? '!important' : ''}; @@ -808,6 +812,8 @@ export const keepTextAlignment = (document: Document) => { const computedStyle = window.getComputedStyle(el); if (computedStyle.textAlign === 'center') { el.classList.add('aligned-center'); + } else if (computedStyle.textAlign === 'left') { + el.classList.add('aligned-left'); } else if (computedStyle.textAlign === 'right') { el.classList.add('aligned-right'); } else if (computedStyle.textAlign === 'justify') {