Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fonts, Style tweaks: smaller menus to see more of the book #5863

Merged
merged 3 commits into from Feb 15, 2020

Conversation

poire-z
Copy link
Contributor

@poire-z poire-z commented Feb 14, 2020

Show only 5 fonts by menu page to get more room below to see how the text looks with the selected font. Not sure everybody will like that (needs to extend your thumb more to browse menu pages), but the net effect is that you see the font and don't need to close the menu as previously to appreciate how it looks, and go back re-opening that menu to test another font.

fontmenu

Re-organize style tweaks into more submenus to also get more room below.
Add a few styletweaks: "No indentation on first/following paragraphs" #4358 (comment), "Paragraphs margins and paddings", and Links underlining.
Popup footnotes: some CSS fixes #5859 (comment)


This change is Reviewable

@poire-z poire-z added this to the 2020.03 milestone Feb 14, 2020
title = _("Indentation on first paragraph line"),
description = _("Indentation on the first line of a paragraph is the default, but it may be overridden by publisher styles. This will force KOReader's defaults on common elements."),
css = [[
title = _("Paragraphs first line indentation"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title = _("Paragraphs first line indentation"),
title = _("Paragraph first-line indentation"),

title = _("No spacing between paragraphs"),
description = _("No whitespace between paragraphs is the default, but it may be overridden by publisher styles. This will re-enable it for paragraphs and list items."),
css = [[p, li { margin-top: 0 !important; margin-bottom: 0 !important; }]],
title = _("Paragraphs margins and paddings"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title = _("Paragraphs margins and paddings"),
title = _("Paragraph margin and padding"),
Suggested change
title = _("Paragraphs margins and paddings"),
title = _("Paragraph margins and paddings"),
Suggested change
title = _("Paragraphs margins and paddings"),
title = _("Paragraph spacing"),

title = _("Paragraphs margins and paddings"),
{
id = "margin_horizontal_most_0";
title = _("Ignore paragraphs horizontal margins"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This collection sounds a bit awkward, mainly because of the adjective order.

Suggested change
title = _("Ignore paragraphs horizontal margins"),
title = _("Ignore horizontal paragraph margins"),

},
{
id = "margin_vertical_most_0";
title = _("Ignore paragraphs vertical margins"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title = _("Ignore paragraphs vertical margins"),
title = _("Ignore vertical paragraph margins"),

},
{
id = "padding_horizontal_most_0";
title = _("Ignore paragraphs horizontal padding"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title = _("Ignore paragraphs horizontal padding"),
title = _("Ignore horizontal paragraph padding"),

},
{
id = "padding_vertical_most_0";
title = _("Ignore paragraphs vertical padding"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title = _("Ignore paragraphs vertical padding"),
title = _("Ignore vertical paragraph padding"),

@Frenzie
Copy link
Member

Frenzie commented Feb 14, 2020

@poire-z Btw did you want to implement #5859 (comment) or shall I? I basically just want to add those same minor adjustments to the readerdictionary styles, like this:

blockquote { margin: 0 1em; } /* or maybe 0 0 0 1em */
dd { margin: 0 1em; }  /* or maybe 0 0 0 1em */

@poire-z
Copy link
Contributor Author

poire-z commented Feb 14, 2020

did you want to implement [CSS tweaks for HTML dict]

Not really, please go at it (and I have no complex dict to check and decide which is best :)

@poire-z
Copy link
Contributor Author

poire-z commented Feb 14, 2020

About Paragraph margin and padding, I can't use your suggested "Paragraph spacing" because there is already one, that contains the 3 tweaks you added in the past:

image

The 3 sub-menus in that order:
image

image

image

But actually, "No spacing between paragraphs" has the same CSS content as "Ignore paragraphs vertical margins".
But "Spacing between paragraphs" is more for esthetics or personal preferences, while the ones I added in "Ignore paragraphs vertical margins" is more as a help to kill publisher errors or really bad choices.
So, I dunno, may be I could move "Ignore vertical paragraphs padding" into the "Spacing between paragraphs", as it's also about vertical spacing - and that avoids the duplication.
And move the 2 Horizontal padding/margins in another submenu, as they are less often needed (but good to have available). Either in the main paragraph menu, or as a submenu inside "First line indentation" (as it's about horizontal stuff, but it's not indentation as advertized by the menu name).

Any thoughts?

@Frenzie
Copy link
Member

Frenzie commented Feb 14, 2020

It sounds the most logical to put vertical margin/padding in the existing spacing menu, and horizontal margin/padding as a submenu in the main paragraph menu.

To fit more lines in the popup, and to look more like
how crengine epub.css would render the content.
Also normalize some horizontal margins.
To get more room below to see how the text looks
with the selected font.
Try to limit the nb of items per menu page to 5 or 6 by
splitting related ones into sub-menus, so we get more
room below to see how they affect the content.
Adds "No indentation on first/following paragraphs" and
"Paragraphs margins and paddings", and Links underlining.
@poire-z
Copy link
Contributor Author

poire-z commented Feb 14, 2020

Simplified the TouchMenu per_page handling (we didn't really need a stack... updating a single place was enough :)

As for the paragraphs tweaks, reorganized and avoiding the duplicate, that would give:
image

image

image

@Frenzie
Copy link
Member

Frenzie commented Feb 15, 2020

@poire-z Did you still want to change anything or ready to go?

@poire-z
Copy link
Contributor Author

poire-z commented Feb 15, 2020

Nope, ready to go (was just waiting a bit after release in case we needed some hot fix without any new stuff - or for another first commit after release, that you just did :)

@poire-z poire-z merged commit f0c6fc9 into koreader:master Feb 15, 2020
@poire-z poire-z deleted the more_room branch February 15, 2020 11:32
@poire-z
Copy link
Contributor Author

poire-z commented Jun 13, 2022

I'd like to add a style tweak like this one:
image
I think it might help with the kind of book that sets a font size and needs us to need to change our default font size value to try to approximate what we are used to (@zwim has met this kind of book, #9159 (comment)), with usually a feeling of "something's still not as I'm used to" :)
(But I'm not yet super sure it's efficient - it looks alright, I may have use somethig like it when fighting books, but somehow I don't think about it everytime, so not much experience yet.)
It's less radical than the "Ignore publisher font size", which would also reset the font size of heading/titles which makes everything becomes flat :)

Any rewording suggestion, for this one and/or the existing one ?

Also, I'm a bit bothered getting now 6 items in this menu (although 6 is still fine, but 5 is best for such things we want to see more of its effect without closing the menu).
Thoughts about reorganizing all that ?
Or moving Smaller sub- and superscript elsewhere ? (I rarely use it, it came from before Enforce steady line-height which is better at most things. But I'm not sure I want to remove existing ones, people may be using them.)

It wouldn't help with making it smaller, but I realize there are a few things that may be badly organized:

  • Widows and orphans is in Text> , while I think it's rather about Paragraphs, or paragraphs in the context of Pages
  • Paragraphs> is a bit crowded (with List items> which is somehow still a bit related)
  • Horizontal paragraph margins> could go into Pages> if we rename it Pages and margins>
  • could In-page footnotes> have their place into... Pages> / Pages and margins> ?

Any thoughts ?

@NiLuJe
Copy link
Member

NiLuJe commented Jun 13, 2022

  • Yes please on the new tweak ;).
  • Moving sub/super-script elsewhere sounds good (where to, though :D).
  • Windows & orphans probably makes more sense in the context of Pages, yeah.
  • Pages and margins sounds good.
  • Moving footnotes makes some sense, but might not necessarily be needed?

@Frenzie
Copy link
Member

Frenzie commented Jun 13, 2022

Nothing much to add to that.

Moving the footnotes would probably be fine but I don't think it's necessary.

Maybe a few more elements? Such as div and blockquote? And what about line-height: initial or 1.5 or something?

@zwim
Copy link
Contributor

zwim commented Jun 13, 2022

I am not quite sure, there are ignore publisher entries scattered around in the whole style tweaks menu. They are sorted into sane places. But the question is: Does the user recognise if the padding happens in a table environment or anywhere else? Is it a font or a line hight problem...

Most books get rendered very well (I like it!). But if I open a misbehaving one, where do I look first? -> In the "Style tweak - Ignore publisher menu". (Because I trust KOReader ). Hhmm there is no such menu entry, so let's go through the numerous submenus until I find the right one (maybe by trial an error).

So shouldn't we discuss to bundle all the "Ignore vendors" in one submenu?
(I am aware that the style tweak top menu us already crowded, but eventually we can merge some if the ignore entries go away.)

@poire-z
Copy link
Contributor Author

poire-z commented Jun 14, 2022

And what about line-height: initial or 1.5 or something?

That's best left to the "Ignore publisher line-height" - and we can then use our bottom menu widget to tweak it (rather than forcing 1.5 or needing other values).

But the question is: Does the user recognise if the padding happens in a table environment or anywhere else? Is it a font or a line hight problem...
Most books get rendered very well (I like it!). But if I open a misbehaving one, where do I look first? -> In the "Style tweak - Ignore publisher menu". (Because I trust KOReader ). Hhmm there is no such menu entry, so let's go through the numerous submenus until I find the right one (maybe by trial an error).
So shouldn't we discuss to bundle all the "Ignore vendors" in one submenu?

That could be a way to lay out the menu, but I don't think it would really be better:

  • There are Style tweaks, not just Style killers :) We propose a few other stuff than just killing and restoring, and depending on some, there is no real killing, just overwritting individual bits (ie paragraphs first line indendation and spacing, there are multiple combinations possible before killing everything and getting the normal epub.css rendering. Also, some tweaks are named "Ignore publisher xyz" possibly arbitrarily, but could as well be "Force xyz to be abc" - and I'm sure we have some of these, depending on how the name and description would sound.
  • if you would move all the ones that "Ignore publisher something" into its own section, you would have > 15 items that you would need to put into subsections to get 5 items per page and see part of the book content - or you would have a 3 pages menu with many things not really organized. And if subsections for Ignore tweaks, you would duplicate the sections in the other menu for non-Ignore publisher stuff. And related things would be scattered around.
  • I trust a user to at least know if what he wants to fight is text/fonts, paragraphs margins, or tables :) and go to the right place to see what's offered. It might be technical HTML/CSS stuff, but the casual name and description we give should be simple enough - and may educate the curious user.
  • Otherwise, we may have a "Enable some random Ignore tweaks" button, that the user will hit and we'll pick a random combination of Ignore tweaks :) and at some point (after 137 re-renderings), he may get lucky and have its issues solved :)
  • And yes, for some issues, it's trial and error, even for me. Especially everything margins: that's why we have many such tweaks, that may make more sense once in Pages and margins: killing Page margins is obvious, but may not be enough. Killing paragraph margins may not work if the book use DIV or BLOCKQUOTE. Killing horizontal margins may kill too much (and you lose the margin/indentation that may be used for quotes/blockquotes). And sometimes none of these will work because the publisher uses padding, not margin... So, we have Kill horizontal or paragraph margin and kill paddings :)
    The distinction between what is padding and margin is indeed technical CSS and may not talk to some users. But I think it's still better that using Ignore paragraph margins (try this first) and Ignore paragraph margins (try that one if the other fails)

tldr: Style tweaks is a zoo showing the diversity of CSS/HTML layout that one should enjoy and learn. It's not a mafia restaurant where you go to hire killers, that will miss their target half of the time :) You often end up needing to do the dirty work yourself :)

@poire-z
Copy link
Contributor Author

poire-z commented Jun 15, 2022

About the idea of moving Ignore horizontal paragraph margins from Paragraphs> to Page and margins>, to have all the margins arsenal at one place:
image
image (a bit so-so though)

it would add another kind of confusion, as some of the paragraphs vertical margins is already (rightly I think) located in Paragraphs> Spacing between paragraphs>
image

Unless we consider horizontal margins an annoyance, and vertical margins a feature/style choice of paragraphs.

Or instead of regrouping like on the second screenshots (section for h/v margins, section for h/v padding - the distinction between padding and margin being a bit obscure), we go with grouping by horizontal:
Ignore all vertical margins (which will include paddings) as a radical killer for vertical spacing
----------------
Ignore all horizontal margins (which will include paddings)
Ignore horizontal containers margins (which will include paddings) (for DIV, just in case? and/or "sub containers" like BLOCKQUOTE ?)
Ignore horizontal paragraphs margins (which will include paddings) (for P, LI)

Although sometimes, it's nice to have that padding/margin granularity as it happens using one or the other kill the unwanted margin while leaving some other wanted ones, but it's mostly luck :)

But such changes would need us ro rename the tweaks' ids and may change some current users layouts...
So, may be we should keep that.
And just keep them and put them in a horizontal stuff section and in a vertical stuff section.

I could also duplicate (same twead id and css) some of the paragraph spacing stuff into Ignore margin stuff...

Well, no real obviously less confusing ideas for now...

Also, a precision to my previous post: Most of the Ignore publisher xyz are actually doing set xyz to 0 (which is ok with our epub.css where we like using 0 - but html5.css does specify some margins/padding, that will be killed by these tweaks).
And Ignore publisher font sizes is actually a lie: it sets all font size (publisher or ours) to normal, and it overrides our sizes we set in epub.css for H1 H2 H3...

@Frenzie
Copy link
Member

Frenzie commented Jun 15, 2022

Most of the Ignore publisher xyz are actually doing set xyz to 0

What happens right now if you use initial?

@poire-z
Copy link
Contributor Author

poire-z commented Jun 15, 2022

crengine does not support initial for any property currently.
But if it were (just pick the value from the initial values of a just instantiated css_style_rec), it would be 0 for margin/paddings, and inherit for most stuff (ok, we use * { inherit} for font and line-height tweaks, so it's fetched from what was set on the root node: our values, which is indeed better than using 0 :)

@poire-z
Copy link
Contributor Author

poire-z commented Jun 17, 2022

I have reorganized a bit our style tweaks, making the main menu and others smaller:
image
Too many stuff moved around or into submenus to make screenshots, so I'm giving the file here:
css_tweaks.lua.txt
Please replace your frontend/ui/data/css_tweaks.lua with this file and browse around and tell me if all make sense.

Changes:

  • moved margins stuff into Page and margins, splitting horizontal from vertical (as we know if what we're fighting is space on the left or right, or between blocks)
  • moved In-page footnotes inside Page and margins, as it really feels about Pages :) as much as Widows and orphans - but tell me is this is too much a change and people who are used to find it in Misc> may panic :) (I guess it's one of the most often accessed):
    image
  • Splitted Font size and Line heights into 2 submenus - so more room to see effects and eventually add more tweaks. Move Smaller sub/super scripts into Line heights> (feels at home there).
  • Thought about duplicating (as mentionned in previous posts) paragraph vertical spacing into Page and margins, but there's a small issue that we would see Style tweaks (1) (as it's the same tweak id), but when opening the menu, we would see Pages and margins (1) and Paragraphs (1) , and 1+1 = 1 is something that bothers me :). So, I made the paragraph one targets only p {} and the Page and margins> Ignore paragraphs margins target p, li {}.
  • Move List items> Force bullets/decimal into Miscellaenous> as it doesn't really need to be in Paragraphs>
  • Moved Tables, links, images into their own submenu, as rarely used

@poire-z
Copy link
Contributor Author

poire-z commented Jun 17, 2022

moved In-page footnotes inside Page and margins

Minor personal issue with this: previously, I saw Miscellaneous (1)> and Pages (1)> which was a quick hint for me that epub in-page foonotes was enabled, and that I had probably enabled Ignore publisher page margins.
Now, I see Page and margins (2)> and the hint is less clear :)

Another question, regarding in-page footnotes.
I often get this kind of footnote rendering, with text-indent:
image
that I always end up fighting with a book style tweak, to get:
image

Is this only my personal taste ? Or is it obvious :) the second one is better (the number being enough to see a new footnote start, and easier to find when not indented) ?

Another issue I have with the Reset main text font side I want to add (and added in the css_tweaks.lua in previous post):
body, p, li, div, blockquote { font-size: 1rem !important; }
is that it would override the smallness of In-page EPUB footnotes (smaller)
*[type~="footnote"] { -cr-hint: footnote-inpage; ... font-size: 0.8rem !important;}
when we have the type=footnote set on a <aside> with a <p> inside that contains the text:

<aside class="ntb" epub:type="footnote" id="ftn102">
  <p class="note"><a class="notesymbol" href="chapitre13.xhtml#bodyftn102">102</a> Some stuff.</p>
</aside>

This construct is very common in French books.

I can't/don't want to add to the existing tweak:

*[type~="note"] p,
*[type~="endnote"] p,
*[type~="footnote"] p,
*[type~="rearnote"] p,
*[role~="doc-note"] p,
*[role~="doc-endnote"] p,
*[role~="doc-footnote"] p,
*[role~="doc-rearnote"] p
{
        font-size: 0.8rem !important;
}

as it feels these would make the CSS checks&apply a lot slower on books (checking all ancestors of all P)...
I may end up just adding:
aside[type~="footnote"] > p { font-size: 0.8rem !important; }
(I have only 2 mobileread-user-made books that use <aside type="rearnote"> that I'm ok ignoring.)

Thoughts?

@mergen3107
Copy link
Contributor

Is this only my personal taste ?

I too think unindented looks better. Also it saves space, so more useful notes can fit.

@poire-z
Copy link
Contributor Author

poire-z commented Jun 27, 2022

I'm brainbreezing (gentle brainstorming) with the idea of adding an internal CSS property/bitmap, in a way similar to the -cr-hint: we have (setting hints for the engine from away), but that would actually be set by the engine, so we can catch it with -cr-only-if: in our CSS snippets.

We could then have the engine set (by early inheritance of this new property) hinted: inside-inpage-footnote when a parent was met getting -cr-hint: inpage-footnote - and hinted: block when the element is a DIV/P... or hinted: inline when it's a SPAN/EM/B.

We then could use something like the following in individual style tweaks that could be "added" once a EPUB/Wikipedia/ClassicClassname has been used succesfully (instead of having to duplicate each of them with "(smaller)").

* {
  -cr-only-if: inside-inpage-footnote block;
    font-size: 0.8rem !important; /* only if block, keep <sup> smaller font size */
}

(instead of the longer and less efficient suggestion in my previous post).

And, to counteract any nested blocks (or DL/DT/DD like I've met recently) that would put the footnote number on a paragraph, and the text in another, and make everything smoothly inline

* {
  -cr-only-if: inside-inpage-footnote block;
    display: inline !important;
}

I would use "cr_hinted" as the name for this internal property - but any thought about a better name for it, that would be sufficiently different from "cr_hint" ? I found "clue" or "cue" as small synonyms, but I'm not really used to these words (or they don't sound as clear as "hint" to me). Or "colored: inside-inpage-footnote" or "scent: block" :) Thoughts?

@Frenzie
Copy link
Member

Frenzie commented Jun 27, 2022

And, to counteract any nested blocks (or DL/DT/DD like I've met recently) that would put the footnote number on a paragraph, and the text in another, and make everything smoothly inline

Do you mean they were excessively large? Having a bit of a list or a couple of paragraphs or something sounds a-okay to me and forcing them to be inline like a net negative.

I would use "cr_hinted" as the name for this internal property - but any thought about a better name for it, that would be sufficiently different from "cr_hint" ? I found "clue" or "cue" as small synonyms, but I'm not really used to these words (or they don't sound as clear as "hint" to me). Or "colored: inside-inpage-footnote" or "scent: block" :) Thoughts?

I'm not sure if I quite understand the "hinted" phrasing. Isn't it more of a context?

@poire-z
Copy link
Contributor Author

poire-z commented Jun 27, 2022

Do you mean they were excessively large?

No, it was a bunch of:

<body>
<dl class="notes">
<dt id="footnote-102" class="calibre5">[<a href="index_split_018.xhtml#citation-102" class="calibre6">102</a>
]</dt>
<dd class="calibre7" id="calibre_pb_131"><p class="p-p53">blah blah</p></dd>
</dl>
</body>

which where rendered (as dt and dd are block elements) as:
image

We can also get that kind of stuff with other contexts, like a bunch of DIV (when the publisher decides to make a new page for each footnote).

Having a bit of a list or a couple of paragraphs or something sounds a-okay to me and forcing them to be inline like a net negative.

It would only be an option. Fighting the above dt dl ended me having to type/test/use:

.notes { -cr-hint: footnote-inpage; margin: 0 !important;}
.notes > dt { display: inline !important; font-size: 1em !important}
.notes > dd, .notes > dd > p { display: inline !important; font-size: 1em !important}

With the above solution, I would just enable these 2 tweaks, and they would work.
Of course, they would break footnotes that have multiple paragraphs by making all of them inline - but that's my decision (no forcing :) it's just an available tweak, to use when needed) - I could initially have a quick browsing in scroll mode of all the footnotes to see if they have multiple paragraphs and blockquotes and such - and what loss I would get.

I'm not sure if I quite understand the "hinted" phrasing. Isn't it more of a context?

Yep, cr_context would work ! and would not sound like anything existing in the CSS domain. I will probably go with that, thanks :)

@Frenzie
Copy link
Member

Frenzie commented Jun 27, 2022

It would only be an option. Fighting the above dt dl ended me having to type/test/use:

Makes sense. :-)

@poire-z
Copy link
Contributor Author

poire-z commented Jul 3, 2022

About my above idea of using:

* {
  -cr-only-if: inside-inpage-footnote block;
    display: inline !important;
}

I had some obvious issue with CSS specificity: * being super low specificity, it would be checked/applied very early, before any other p[type=footnote] or p.footnote get a chance to actually make the node "inpage-footnote".

So, I had to add some way to increase the specificity of some selectors.
I could have gone with so at-rule like @cr-late { * { .. } }, but that's a bit complicated to implement, and for users to add/remove/temporarily disable.
(CSS specs has got recently something for that purpose, @layer https://github.com/w3c/csswg-drafts/issues/4470 but it's even more complicated to grasp.)

So, I'll go with just -cr-hint: late : add this in a declaration, and all the selectors gets a specificy huge bump. Make a typo in late to just disable it.

@poire-z
Copy link
Contributor Author

poire-z commented Jul 3, 2022

So, I'm reworking the "In-page footnotes" submenu.
With the idea that we enable some footnote type, and we tweak how they should look with other menu items.
image

It's a bit more logical and practical, and it allows tuning / taming down publisher footnotes look, including the one we would need to enable via a book style tweak when none of the 3 existing enabling tweak work.
But then, if we remove "EPUB footnote (smaller)" (that we currently set as global default), because it's redundant, either the user will get footnote with the publisher text size (which can be normal or smaller), which might look not as nice as our current default.
Or we have to set as global "Footnote font size 80%", but then, we force all footnotes to be 80%, and users won't see the publisher initial size choices...
(And if we force as global default a font size of 80%, we also killing the FB2 footnotes 0.75rem / 0.85rem distinction for footnotes vs endnotes...)

So, I have a super toolkit menu to tame down footnotes, but no real nice first time experience for a normal user.
The experience is ok for me and my workflow: I open a new book, I see what it has: footnotes with the normal publisher text size - and then, I tweak/tame down everything.
So, I'm a bit stuck on how to go with that :/


My updated "Inpage-footnotes" menu would be:

In-page EPUB footnotes

Show EPUB footnote text at the bottom of pages that contain links to them. This only works with footnotes that have specific attributes set by the publisher.

*[type~="note"],
*[type~="endnote"],
*[type~="footnote"],
*[type~="rearnote"],
*[role~="doc-note"],
*[role~="doc-endnote"],
*[role~="doc-footnote"],
*[role~="doc-rearnote"]
{
    -cr-only-if: -fb2-document;
        -cr-hint: footnote-inpage;
        margin: 0 !important;
}

In-page Wikipedia footnotes

Show footnotes at the bottom of pages in Wikipedia EPUBs.

ol.references > li {
    -cr-hint: footnote-inpage;
    list-style-position: -cr-outside;
    margin: 0 !important;
}
/* hide backlinks */
ol.references > li > .noprint { display: none; }
ol.references > li > .mw-cite-backlink { display: none; }

In-page classic classname footnotes

Show footnotes with classic classnames at the bottom of pages. This tweak can be duplicated as a user style tweak when books contain footnotes wrapped with other class names.

.footnote, .footnotes, .fn,
.note, .note1, .note2, .note3,
.ntb, .ntb-txt, .ntb-txt-j,
.przypis, .przypis1, /* Polish footnotes */
.voetnoten /* Dutch footnotes */
{
    -cr-hint: footnote-inpage;
    margin: 0 !important;
}

In-page footnote font size

Footnote font size: 100 %

*, autoBoxing {
    -cr-hint: late;
    -cr-only-if: inside-inpage-footnote -inline;
        font-size: 1rem !important;
}

Footnote font size: 90 %

*, autoBoxing {
    -cr-hint: late;
    -cr-only-if: inside-inpage-footnote -inline;
        font-size: 0.9rem !important;
}

Footnote font size: 85 %

*, autoBoxing {
    -cr-hint: late;
    -cr-only-if: inside-inpage-footnote -inline;
        font-size: 0.85rem !important;
}

Footnote font size: 80 %

*, autoBoxing {
    -cr-hint: late;
    -cr-only-if: inside-inpage-footnote -inline;
        font-size: 0.8rem !important;
}

Footnote font size: 75 %

*, autoBoxing {
    -cr-hint: late;
    -cr-only-if: inside-inpage-footnote -inline;
        font-size: 0.75rem !important;
}

Footnote font size: 70 %

*, autoBoxing {
    -cr-hint: late;
    -cr-only-if: inside-inpage-footnote -inline;
        font-size: 0.7rem !important;
}

Footnote font size: 65 %

*, autoBoxing {
    -cr-hint: late;
    -cr-only-if: inside-inpage-footnote -inline;
        font-size: 0.65rem !important;
}

In-page footnote cleanup

No footnote indentation

* {
    -cr-hint: late;
    -cr-only-if: inside-inpage-footnote;
        text-indent: 0 !important;
}

Justify footnote text

* {
    -cr-hint: late;
    -cr-only-if: inside-inpage-footnote;
        text-align: justify !important;
}

Remove block margins

Remove block margin and padding inside inpage footnotes.

* {
    -cr-hint: late;
    -cr-only-if: inside-inpage-footnote -inline;
        margin: 0 !important;
        padding: 0 !important;
}

Remove cosmetic spacing

Remove any margin and padding inside inpage footnotes, including between inline elements.

* {
    -cr-hint: late;
    -cr-only-if: inside-inpage-footnote;
        margin: 0 !important;
        padding: 0 !important;
}

Inline all footnote content

If the footnote number is on a single line and the footnote text on the next line, or if there are variable levels of indentation, this tweak can make all the footnote content become a single paragraph. This will break any complex footnote containing quotes or lists.

* {
    -cr-hint: late;
    -cr-only-if: inside-inpage-footnote -inpage-footnote -inline;
        display: inline !important;
}
* {
    -cr-hint: late;
    -cr-only-if: inside-inpage-footnote;
        list-style-position: inside;
}

Regularize text size on inline elements

If the footnote text uses variable or absolute font sizes, line height or vertical alignments, which would make it too irregular, you can reset all of them to get a leaner text (to the expense of loosing superscripts).

* {
    -cr-hint: late;
    -cr-only-if: inside-inpage-footnote -inpage-footnote;
        font-size: inherit !important;
        line-height: inherit !important;
        vertical-align: inherit !important;
}

(Generated with #9261 (comment) - that I allowed myself to fix :)

@Frenzie
Copy link
Member

Frenzie commented Jul 3, 2022

Pardon, what fix? I thought there were no bugs (in the final edit; the initial version was missing escaping). :-P

@poire-z
Copy link
Contributor Author

poire-z commented Jul 3, 2022

See the github "Edited by" diff: you were iterating twice, they were duplicated stuff, and some missing ones.

@Frenzie
Copy link
Member

Frenzie commented Jul 3, 2022

Ah, I wouldn't have been able to spot any difference without the diff. In my defense, I wrote it in 5-10 minutes. ;-D

@poire-z
Copy link
Contributor Author

poire-z commented Jul 3, 2022

Or we should keep the 3 ... (smaller) ones , which would avoid any migration or loss of current user tweaks and habits
image

It just makes/keeps this menu quite crowded, with a bit of redundancy with the font size - although it could work: the (smaller) sets the footnote outer container font size (which may have no effect depending on publisher styles), and the other new options can help forcing the font size on inner containers when needed.
The last 2 menus I would be adding could even go into a submenu if I want to save 1 line.

@poire-z
Copy link
Contributor Author

poire-z commented Jul 5, 2022

Mostly unrelated:
Anything against adding swipe south in our top menu to "go back/up", same as the top pointing chevron in the bottom left corner of the menu ? (because, when navigating the menu with one hand and the device in the right hand, reaching this button on the left is tedious, and one needs his left hand).

--- a/frontend/ui/widget/touchmenu.lua
+++ b/frontend/ui/widget/touchmenu.lua
@@ -815,16 +815,18 @@ end
 function TouchMenu:onSwipe(arg, ges_ev)
     local direction = BD.flipDirectionIfMirroredUILayout(ges_ev.direction)
     if direction == "west" then
         self:onNextPage()
     elseif direction == "east" then
         self:onPrevPage()
     elseif direction == "north" then
         self:closeMenu()
+    elseif direction == "south" then
+        self:onBack()
     end
 end

@zwim
Copy link
Contributor

zwim commented Jul 6, 2022

Maybe a stupid question. The chevron points up (north ) but the swipe should go down (south )?
Isn't that confusing?

@poire-z
Copy link
Contributor Author

poire-z commented Jul 6, 2022

The chevron points up (north ) but the swipe should go down (south )?
Isn't that confusing?

Yep, a bit - but people may already get used to close it all with swipe north - and only swipe south is yet unused :)
Unless we just make swipe north "go back", and people used to that will just need to use it multiple times (when go back reach top, next "go back" closes) - and let them discover that swipe south is a shortcut :)

@poire-z
Copy link
Contributor Author

poire-z commented Jul 6, 2022

@Frenzie : any thoughts about the 3 above posts ? as it was you who introduced swipe south/north to open/close the top menu.

@Frenzie
Copy link
Member

Frenzie commented Jul 6, 2022

Unless we just make swipe north "go back"

Closing is significantly more important than going back. Even if you don't want to close the menu per se, it's usually significantly faster to start from scratch unless you specifically want to go just one back (which is what the arrow is for). I very explicitly decided against north to go back.

As to using south to go back, seems a little weird but probably fine?

@mergen3107
Copy link
Contributor

mergen3107 commented Jul 6, 2022

Or we should keep the 3 ... (smaller) ones , which would avoid any migration or loss of current user tweaks and habits

This would be great! I set these smaller ones on by default, I mostly use them in fb2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blockquote handling in html-dictionary. (Sametypesequence=h)
5 participants