From 9377be7e8c19b7ecb1a3a5e9078cf825a9c7ff5c Mon Sep 17 00:00:00 2001 From: poire-z Date: Mon, 8 Oct 2018 18:55:42 +0200 Subject: [PATCH] Style tweaks: adds 2 page break related tweaks So we have more tools to kill empty pages. --- frontend/ui/data/css_tweaks.lua | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/frontend/ui/data/css_tweaks.lua b/frontend/ui/data/css_tweaks.lua index 206db87cf..cf6671c2d 100644 --- a/frontend/ui/data/css_tweaks.lua +++ b/frontend/ui/data/css_tweaks.lua @@ -25,11 +25,32 @@ local CssTweaks = { title = _("Ignore all publisher margins"), priority = 2, css = [[* { margin: 0 !important; }]], + separator = true, }, { id = "titles_page-break-before_avoid "; title = _("Avoid blank page on chapter start"), - css = [[h1, h2, h3, .title, .title1, .title2, .title3 { page-break-before: avoid !important; }]], + priority = 2, -- so it can override the one put back by publisher_page-break-before_avoid + css = [[h1, h2, h3 { page-break-before: auto !important; }]], + + }, + { + id = "docfragment_page-break-before_avoid "; + title = _("Avoid blank page on chapter end"), + priority = 2, -- so it can override the one put back by publisher_page-break-before_avoid + css = [[DocFragment { page-break-before: auto !important; }]], + }, + { + id = "publisher_page-breaks_avoid "; + title = _("Avoid publisher page breaks"), + description = _("Disable all publisher page breaks, keeping only KOReader's epub.css ones.\nWhen combined with the two previous tweaks, all page-breaks are disabled."), + css = [[ +* { page-break-before: auto !important; page-break-after: auto !important; } +/* put back epub.css page-breaks */ +DocFragment { page-break-before: always !important; } +h1, h2, h3 { page-break-before: always !important; page-break-after: avoid !important; } +h4, h5, h6 { page-break-after: avoid !important; } + ]], }, }, {