View Single Post
Old 09-20-2024, 01:50 PM   #22
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,060
Karma: 147977995
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 Turtle91 View Post
Jon...the key words are: "you have to make sure the CSS is considered valid"


Do that using fall-back coding....so if it doesn't understand or support a particular css then it will fall back to coding that it does support....that's all part of good/valid coding...


I will put this example up one more time. Please do some research/learning on how css works. (check out 'CSS order of precedence', and 'specificity') While you are at it, check up on @media and @supports.

{color:blue; color:red; color:green}


will show the color as green because it is the last (most recent) item on the list (not counting styling in the header of the html page, or inline styling)


{height:50%; height:75vh}


will use a height of 75% of the viewable height IF THE DEVICE SUPPORTS VH. If it doesn't support VH then it gracefully ignores it (as required by spec) and falls back to the next most recent item on the list and will use a height of 50%.



Thus you CAN have css that uses the advanced ePub3.3 and/or html5 for the devices that support it, while still being readable on an ePub2 device. You absolutely do NOT have to code for ePub2 only just to be compatible.
What I am meaning is there is some code that does work for ePub 3 but for the older RMSDK that Kobo uses it's treated as an error and thus the entire CSS is ignored. That's what happens with Standard EBooks. They use some code that fails on a Kobo as ePub. That's why you have to make sure the code works well enough for that older version of RMSDK and doesn't cause RMSDK to think of it as an error and ignore the CSS.

The other thing is, if the older ePub 2 type code does work such as % instead of vh, then there's no reason to use vh.

The other thing I'm not sure of is doesn't duplicate code lower down in the CSS get used instead of code higher up? If that is the case, then the % would be ignored for the vh and the code would not work in the older RMSDK.

But what do you do with ePub 3.x CSS that the older RMSDK thinks is an error and ignores the entire CSS? That would mean the code you are using is going to be an issue.

Last edited by JSWolf; 09-20-2024 at 01:54 PM.
JSWolf is offline   Reply With Quote