10-21-2023, 03:55 AM | #1 |
Enthusiast
Posts: 30
Karma: 10
Join Date: Jun 2011
Location: Lima, Peru
Device: Kindle 10Gen / Kobo Aura HD / Nook STR
|
Issues with specificity (epub > azw3)
Hello.
For a while now I've been using the "Single file solution for full-screen images with captions" method from here: https://github.com/jstallent/ImagesSingleFile which basically is to use two types of measures for images (percentage and viewport). Code:
.image1 img { height: 85%; } .image1 img:only-of-type { height: 85vh; } However, placed like this, the Calibre conversion to azw3 takes the last measure (viewport), which Kindle doesn't recognize. If we invert them, everything is fine (it takes the last one, percentage this time): Code:
.image1 img:only-of-type { height: 85vh; } .image1 img { height: 85%; } So far, the latter way has worked fine for me, both in epubs and converted azw3s (and thus avoids adding an extra @media amzn-kf8). I would like to know if this behavior is as expected or if it could change in the future… An idea: if both measurements are found and the conversion is for Kindle, could Calibre automatically discard viewport and use percentage? Thanks in advance (and sorry for my terrible English). [Calibre 6.29.0, Windows 11-64bits, default conversion options (I think). I'm attaching the test epub, the converted azw3 and the log.] |
10-21-2023, 04:41 AM | #2 |
creator of calibre
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Just use svg it has worked well on all devices for over a decade. No need to try and get overly clever with css. calibre conversion uses the specificity that comes from the css_parser (fork of cssutils) python library, so you would need to check there.
See https://manual.calibre-ebook.com/con...ormatting-demo for an demo epub file which shows you how to do full screen images with text |
10-21-2023, 05:09 AM | #3 |
creator of calibre
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
And that's the fix for css-parser: https://github.com/ebook-utils/css-p...ded44ad99d2ddf
|
10-21-2023, 07:13 AM | #4 |
the rook, bossing Never.
Posts: 11,171
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Never use vh.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Two issues with EPUB->AZW3 conversion: Cover in TOC and Start/Begin | Zillion_ | Conversion | 1 | 07-30-2023 03:24 PM |
(Solution) Formatting issues converting from azw3 to epub | SillyStegosaurus | Conversion | 29 | 07-27-2023 03:36 PM |
AZW3 and PDF issues | olbeggaols | Kobo Reader | 6 | 05-05-2021 03:05 PM |
epub to azw3 conversion formatting issues | topquark | Conversion | 45 | 07-31-2014 05:28 AM |
azw3 to epup issues | shentar | Conversion | 10 | 07-16-2014 05:50 AM |