CSS Processing order
#1  BobC 05-27-2020, 03:46 PM
I see that KoReader can have user created styles (in /styletweaks) .

When reading a book there may also be other stylesheets that will influence presentation. Such as, say, one called "book.css" within an EPUB, (the so-called "embedded style").

Then there is the inbuilt "epub.css".

I'm trying to understand in what order the various css stylesheets will be processed.

Understanding this would explain why I was getting indented paragraphs on the first line of a chapter when I wasn't expecting it from the book's own styles. I have since edited that EPUB to display correctly but would like to know the "cascade" order as it might help me correct the presentation of other books by KoReader if I find others with the same problem.

An authoritative view on this would be appreciated.


#2  Frenzie 05-27-2020, 05:20 PM
Some discussion here but that may be completely outdated. (@poire-z will probably see this comment soon enough. )

#3  Frenzie 05-28-2020, 03:11 AM

It's what I thought but I didn't want to commit "authoritatively".

#4  BobC 05-30-2020, 02:05 PM
Quote Frenzie

It's what I thought but I didn't want to commit "authoritatively".
However you did get me an answer that solved my problem.

I was looking for an "authoritative" answer as I didn't want to have to wade through a load of opinions on how it would work on <insert name of other software>.

The book in question was one I had built the css for and I've learned a lesson about making sure that I don't rely on selectors having a value unless I've declared it, and just because it displays the way I expected in Calibre's preview (or Sigil, or Adobe) it will behave the same using other software such as KoReader.

So thanks for raising it on Github and getting me the answer.


Today's Posts | Search this Thread | Login | Register