From 56d54d2c1ad953c22b18b72faef9879913435510 Mon Sep 17 00:00:00 2001 From: poire-z Date: Sat, 27 Nov 2021 17:00:28 +0100 Subject: [PATCH] Style tweaks: have "Justify most/all text" work on txt documents --- frontend/ui/data/css_tweaks.lua | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/frontend/ui/data/css_tweaks.lua b/frontend/ui/data/css_tweaks.lua index 2a60e4637..983f3ebd4 100644 --- a/frontend/ui/data/css_tweaks.lua +++ b/frontend/ui/data/css_tweaks.lua @@ -159,13 +159,26 @@ h1 + h6, h2 + h6, h3 + h6, h4 + h6, h5 + h6 { page-break-before: avoid !importan id = "text_align_most_justify", title = _("Justify most text"), description = _("Text justification is the default, but it may be overridden by publisher styles. This will re-enable it for most common text elements."), - css = [[body, p, li { text-align: justify !important; }]], + css = [[ +body, p, li { text-align: justify !important; } +pre { + -cr-only-if: txt-document; + text-align: justify !important; + white-space: normal; +} + ]], }, { id = "text_align_all_justify", title = _("Justify all elements"), description = _("Text justification is the default, but it may be overridden by publisher styles. This will force justification on all elements, some of which may not be centered as expected."), - css = [[* { text-align: justify !important; }]], + css = [[ +* { text-align: justify !important; } +pre { + -cr-only-if: txt-document; + white-space: normal; +} + ]], separator = true, }, {