From 8ffb9aff648cf0c9ca6bbb89a94d7e06ec32a121 Mon Sep 17 00:00:00 2001 From: poire-z Date: Mon, 10 Feb 2020 17:29:17 +0100 Subject: [PATCH] Wikipedia EPUBs: keep original float left/right in web mode Previous cleanup resurrected multiple class names, so we know now the original alignment of a float. Use them in 'web' mode, as it allows floats to be nearer the section they are refering to, and it may limit floats truncation in page splitting. But keep floats aligned on a single side in 'book' mode, as it might allow easier reading. --- frontend/ui/wikipedia.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/frontend/ui/wikipedia.lua b/frontend/ui/wikipedia.lua index cfc0d6e45..9eb046910 100644 --- a/frontend/ui/wikipedia.lua +++ b/frontend/ui/wikipedia.lua @@ -1030,6 +1030,20 @@ body > div:dir(rtl) > div.thumb { /* invert if RTL */ clear: left; margin: 0 0.5em 0.2em 0 !important; } +/* Allow original mix of left/right floats in web mode */ +body > div > div.thumb.tleft { + -cr-only-if: float-floatboxes allow-style-w-h-absolute-units; + float: left !important; + clear: left; + margin: 0 0.5em 0.2em 0 !important; +} +body > div > div.thumb.tright { + -cr-only-if: float-floatboxes allow-style-w-h-absolute-units; + float: right !important; + clear: right; + margin: 0 0 0.2em 0.5em !important; +} + body > div > div.thumb img { /* Make float's inner images 100% of their container's width when not in "web" mode */ -cr-only-if: float-floatboxes -allow-style-w-h-absolute-units;