View Single Post
Old 01-14-2015, 08:35 PM   #1184
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
I think using Kobo's style-hacks.css is a bad idea, as as it will change the book's existing styles for no reason, and if someone wants the styles changed in that way then they can always add it to their own kobo_extra.css. The div#book-inner * {margin-top: 0; margin-bottom:0;} rule sets the margin for everything below div#book-inner, but doesn't affect the margin of div#book-inner itself. I think this is the exact opposite of what is desired.

The only rules that might be useful to include in all books might be those which ensure that the extra divs added by the driver don't themselves cause changes to the.book.

An example of how the presence of those divs could change the book is if the book's stylesheet contained a div {margin-left: 1em;} rule. In the original book that would add a 1em left margin to anything enclosed by a div, but in the converted kepub everything is enclosed by two extra divs and so the converted book would have an extra 2em left margin throughout.

To avoid this I would add a rule similar to the following:
Code:
div#book-columns, div#book-inner {
  margin: 0 0 0 0 !important;
  padding: 0 0 0 0 !important;
}
(Some other properties might need to be added to this, such as font-size: 1.0em?) Note there is no * selector following the div selectors, so this rule should only affect the extra divs themselves, and not anything below, and just ensure that margin and padding styles from the original book do not get attached to the extra divs added by the driver.

Then to fix the full-screen cut off bug, the following could be added to the user's kobo_extra.css or to the built-in stylesheet via a firmware patch:
Code:
div#book-columns {padding: 0.2em 0.2em 0.2em 0.2em !important;}

Edit: I might be looking at this issue from a different perspective that the others here, as I don't read sideloaded kepubs (I prefer the epub reader), but I see the reason for the driver adding the book-columns and book-inner divs is because there doesn't seem to be any other way to add them automatically with existing methods, while any css in the stylesheet can be added using the existing kobo_extra.css method.

Edit2: Also it would not be a good idea to break anything that is currently working, as at some point Kobo are likely to fix the full-screen cut off bug and make full-screen mode an official feature, and then the bug fix that depends on the book-columns/book-inner divs will no longer be needed.

Last edited by GeoffR; 01-15-2015 at 01:26 AM. Reason: Also it would not be a good idea to break anything ...
GeoffR is offline   Reply With Quote