|
|
#1 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 561
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
CSS compatibility width: fit-content
Is there any chance of getting KOReader to accept the width: fit-content property/value?
|
|
|
|
|
|
#2 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 561
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
Nothing?
I'm really struggling to understand what CSS elements and properties are compatible with KOReader, and why. I have yet to find a program that reliably gives the user as much control over his/her reading experience as KOReader, but the advanced CSS formatting that it interprets versus that which it ignores is a black box. I understand (and, frankly, align with) the reticence to make KOReader integrate the multimedia elements of ePub3 design, but I am left puzzled by what appears to be an abitrary implementation of modern HTML formatting. Is there at least any sort of reference guide for what works in KOReader and what doesn't? And what (if any) additional HTML/CSS functionalities are likely to be incorporated? |
|
|
|
|
|
#3 | ||
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,822
Karma: 731691
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O, Kobo Libra 2
|
https://wiki.mozilla.org/QA/Minimal_Test_Cases
fit-content is already supported, so without a minimal testcase there isn't really anything to say. Quote:
![]() Quote:
As for what would be added, basically whatever piques someone's interest. Doing preparatory work like providing minimal testcases increases the pique factor. |
||
|
|
|
|
|
#4 | |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 561
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
Quote:
The goal is to have a block of text that is centered in the page but with its contents variably aligned within that block, and constrained by the width of its contents [see FitContentCORRECT.jpg]. Unfortunately, in KOReader, it seems to be ignoring the fit-content value and occupying the full width of the screen (excluding the 5% L/R padding). [see FitContentWRONG.jpg] Last edited by ElMiko; 04-17-2026 at 08:46 AM. |
|
|
|
|
|
|
#5 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,822
Karma: 731691
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O, Kobo Libra 2
|
It looks like the "correct" screenshot for me. You're most likely using an old version or you've changed some render setting.
|
|
|
|
|
|
#6 | |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 561
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
Quote:
I updated and now am getting something similar to what your seeing, but it's still not actually "fitting to content". As you can see from your screenshot, the lines are breaking when they shouldn't be—the "padding" is way more than 5% on either side. EDIT: I think I see what's happening... It's applying the padding after the fit-content, so the content will always render as less than its full width. Presumably, setting the padding to zero and wrapping the whole element in a div with 5% L/R margins will get around this, right? EDIT2: Okay, so there are two approaches here that would work, I think. One is the div wrap, which would be most useful with absolute value margins (e.g. 2em). The other is a max width property within the blockquote itself, which would be most useful for relative boundaries. Last edited by ElMiko; 04-19-2026 at 11:03 AM. |
|
|
|
|
|
|
#7 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,822
Karma: 731691
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O, Kobo Libra 2
|
|
|
|
|
|
|
#8 | |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 561
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
Quote:
In any case, do you know if the workarounds would stop working if KOReader were to align itself with the Sigil/Calibre-type rendering? (FWIW, the workarounds also appear to function as desired in Calibre and Sigil, but that's hardly a guarantee of anything.) EDIT: The two workarounds do seem to work correctly in KOReader currently, too. Last edited by ElMiko; 04-20-2026 at 04:03 PM. |
|
|
|
|
|
|
#9 | ||
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,822
Karma: 731691
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O, Kobo Libra 2
|
Quote:
Quote:
Last edited by Frenzie; 04-21-2026 at 05:54 AM. |
||
|
|
|
|
|
#10 | |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 561
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
Quote:
I'm a little torn now. The Sigil rendering is apparently more commonly adopted, but the KOReader logic is more psychologically soothing. However, I'm fairly confident that the KOR devs didn't conceive of this app with satisfying my mental tics as their principal concern... (and, as per the following paragraph, it appears that my workaround doesn't actually work as well as I'd like, either.) One note about my workarounds (in case anyone is perversely curious): the <div> wrapper solution doesn't play nice with top/bottom margins defined in percentage values at the blockquote level. Presumably, this has something to do with the div wrapper altering the frame of reference by which that percentage would be calculated, rather than just the height of the page. So perhaps not a perfect solution after all... Last edited by ElMiko; 04-21-2026 at 03:22 PM. |
|
|
|
|
|
|
#11 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,822
Karma: 731691
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O, Kobo Libra 2
|
It'll be fixed in https://github.com/koreader/crengine/pull/662
|
|
|
|
|
|
#12 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 354
Karma: 2581190
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on iphone and kindle cloud reader
|
text containing
It is not widely acceptable yet but calibre's viewer can 'contain' font size and therefore container width in the calibre viewer and the calibre text editor. In the viewer you can vary number of columns with ctrl-[ and ctrl-] and 'uncontained font size' with ctrl-minus and ctrl-plus. The text editor lets you vary 'file preview' with edge dragging and font size with track pad. I don't suppose this works well in ebook readers yet.
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| css if img aspect-ratio >1/1 width:100%, otherwise width:50% | rjwse@aol.com | Editor | 0 | 03-19-2021 07:41 AM |
| fit a image to the width of screen | leescott | ePub | 7 | 07-23-2015 10:39 AM |
| K3 - Fit to screen (width) for PDF | nuke | Amazon Kindle | 0 | 09-30-2010 09:27 AM |
| How to center/fit page width SVG images with <OBJECT> | amoroso | ePub | 0 | 07-31-2010 11:48 AM |
| PRS-600 How to make prs600 display PDF fit width? | wifish | Sony Reader | 1 | 12-20-2009 12:28 PM |