From 8d8b8cd0f79455ac4e4bc1dc25524a98a24cdeea Mon Sep 17 00:00:00 2001 From: poire-z Date: Sun, 15 Mar 2020 12:08:24 +0100 Subject: [PATCH] FB2 footnotes: some more tweaks - Add some style tweaks to allow displaying FB2 end notes in-page too - and to allow showing them without a smaller font size. - Show footnote number in bold in popup footnotes. --- frontend/ui/data/css_tweaks.lua | 49 ++++++++++++++++++++++----- frontend/ui/widget/footnotewidget.lua | 4 +++ 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/frontend/ui/data/css_tweaks.lua b/frontend/ui/data/css_tweaks.lua index 2ecbb574b..2dc7224ad 100644 --- a/frontend/ui/data/css_tweaks.lua +++ b/frontend/ui/data/css_tweaks.lua @@ -621,19 +621,52 @@ This is just an example, that will need to be adapted into a user style tweak.]] { title = _("In-page footnotes"), { - id = "footnote-inpage_fb2"; title = _("In-page FB2 footnotes"), - description = _([[ + { + id = "footnote-inpage_fb2"; + title = _("In-page FB2 footnotes"), + description = _([[ Show FB2 footnote text at the bottom of pages that contain links to them.]]), - -- (fb2.css already set font-size to 70% - so no need for a "smaller" variant) - css = [[ -body[name="notes"] section, -body[name="comments"] section -{ + -- Avoid 75% of 75% in case of nested
+ css = [[ +body[name="notes"] section { -cr-hint: footnote-inpage; margin: 0 !important; } - ]], +body[name="notes"] > section { + font-size: 75%; +} + ]], + }, + { + id = "footnote-inpage_fb2_comments"; + title = _("In-page FB2 endnotes"), + description = _([[ +Show FB2 endnote text at the bottom of pages that contain links to them.]]), + css = [[ +body[name="comments"] section { + -cr-hint: footnote-inpage; + margin: 0 !important; +} +body[name="comments"] > section { + font-size: 85%; +} + ]], + separator = true, + }, + { + id = "fb2_footnotes_regular_font_size"; + title = _("Keep regular font size"), + description = _([[ +FB2 footnotes and endnotes get a smaller font size when displayed in-page. This allows them to be shown with the normal font size.]]), + css = [[ +body[name="notes"] > section, +body[name="comments"] > section +{ + font-size: 100% !important; +} + ]], + }, separator = true, }, { diff --git a/frontend/ui/widget/footnotewidget.lua b/frontend/ui/widget/footnotewidget.lua index 9e27e9f0d..dacdcdaa0 100644 --- a/frontend/ui/widget/footnotewidget.lua +++ b/frontend/ui/widget/footnotewidget.lua @@ -104,6 +104,10 @@ body > section > autoBoxing + p, body > section > p + p { display: block; } +body > section > autoBoxing > title, +body > section > title { + font-weight: bold; +} ]] -- Add this if needed for debugging: