View Single Post
Old 06-23-2025, 03:56 PM   #28
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 80,114
Karma: 148951761
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Falkor View Post
Right, for backwards compatibility one would at least have to offer alternatives for all the heights in vh.
The problem is that when you vh or % (ie, margin, height, etc) whichever is second in the CSS is what's used. So if the reading software doesn't do vh, and that's second, it won't do anything. Neither will do anything.



Quote:
The simplest way would be not to provide any fallback at all because it just doesn't work that well in epub2 (and even epub3 without support for initial-letter). So I'd use
Code:
@supports (initial-letter: 2) {…}
around the entire rule. Technically that's not supported by epub2 either, but as invalid rules must be ignored, it still does the trick.

This will also eliminate problems with renderers that support :first-letter, but not initial letter.

If you must have drop caps in epub2 as well, I guess you could still add spans and style them. Then you'd have to undo the span’s styling for all renderers that support initial-letter.
You have to be careful. If ADE 2.0.1 or 3.x thinks your code is a mistake, the entire CSS will be ignored.

What would happen if you had first-letter and a span for a program that supports both? This is a good reason to forgo drop caps if you need ePub2 compatibility.
JSWolf is offline   Reply With Quote