![]() |
#1186 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,638
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#1187 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
Quote:
This brings up the point that for vertical language books, margin-left/right and margin-top/bottom are likely to be interchanged, so the style-hacks.css is likely different for different books. I expect this example was taken from a horizontal language book, and would have very different effects in a vertical language book. |
|
![]() |
![]() |
Advert | |
|
![]() |
#1188 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@GeoffR: Ooh, right, good point. (Yes, that was from a ltr book
![]() |
![]() |
![]() |
![]() |
#1189 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@GeoffR: One issue with enforcing padding on div-inner from here is that the current synced kepub cut-off patch doesn't use !important, and is thus rendered useless, which is a bit counter-productive, since my original intent was to try to make this play nice with this very patch
![]() So I'm currently playing with Code:
div#book-columns, div#book-inner { margin: 0 !important; } Code:
div#book-columns { margin: 0 !important; padding: 0 !important; } div#book-inner { margin: 0 !important; } EDIT: Or even better, see #1191 instead ;p. (and not Code:
div#book-columns, div#book-inner { margin: 0 !important; padding: 0 !important; } instead of Code:
div#book-inner * { margin-top: 0 !important; margin-bottom: 0 !important; } ![]() Last edited by NiLuJe; 01-15-2015 at 06:12 PM. |
![]() |
![]() |
![]() |
#1190 |
Generally Awesome Person
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,100
Karma: 2191133
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
|
The problem with !important is that it stops people from applying their own styles to a book. Which I guess is the publishers trying to impose the same controls they had with print media, but it's a negative user experience when you run into "all my tweaks work except this one that's actually really important for me". You shouldn't need !important anyway, unless something somewhere higher up the priority list is setting the margins or something anywhere else is setting them with !important.
|
![]() |
![]() |
Advert | |
|
![]() |
#1191 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@jgoguen: Agreed. But in this specific instance, if we only strictly apply it to most-likely-unique stuff we're the ones adding, doesn't that alleviate that issue? While still addressing @GeoffR's concern of these new divs inheriting unwanted margin/padding-related properties?
(I'm starting to feel sympathy for people that actually do this kind of stuff for a living ^^). EDIT: On the other hand, a quick test seems to be inconclusive as to whether !important actually 'helps' (in the sense avoiding inheriting margins), so, either I'm doing something wrong, or I'm still confused about how everything interacts with everything ^^. EDIT: Scratch that, there was a third wrapping div in my test file, hence my confusion... -_-". So, take two?: Code:
div#book-columns { margin: 0; padding: 0; } div#book-inner { margin: 0; } Last edited by NiLuJe; 01-15-2015 at 09:38 PM. |
![]() |
![]() |
![]() |
#1192 |
Generally Awesome Person
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,100
Karma: 2191133
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
|
There are circumstances where this would be OK (or at least, relatively not so bad), but never depend on no one else ever writing rules that they would reasonably expect to override yours. !important is best avoided where possible.
I did a lot of web development at a previous job, I was one of those people who wrote a lot of HTML and CSS for a living... ![]() |
![]() |
![]() |
![]() |
#1193 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,638
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
If you're going to do this modification and add important, so my margin definitions can be useless, please, make it optional. I've tested the last version and it works well for me. I know nothing about the bug because I have never seen it.
Last edited by Terisa de morgan; 01-15-2015 at 06:00 PM. |
![]() |
![]() |
![]() |
#1194 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@jgoguen: Got it
![]() ![]() |
![]() |
![]() |
![]() |
#1195 |
Generally Awesome Person
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,100
Karma: 2191133
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
|
Here's a CSS reference, with more than you ever wanted to know (and way more than you need for ebooks!) about CSS
![]() https://developer.mozilla.org/en-US/docs/Web/CSS |
![]() |
![]() |
![]() |
#1196 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
The !important on the properties of the book-columns and book-inner divs is probably not necessary in most cases, except that if there was something like div {margin-left: 1em !important} in the book's stylesheet then that margin would be applied to those added divs too, which would change the book in an unexpected way (since the author has no way to know that the driver is adding extra divs.) However that is probably not very common, so it would be OK to leave it out.
The current firmware patch doesn't use !important when adding padding to these divs because there is currently nothing to override, but I can change it so that the patch uses !important. The order of priority goes like this as I understand it (lowest to highest priority): 1. device stylesheet 2. book stylesheet 3. book stylesheet !important 4. device stylesheet !important So without !important the device stylesheet just provides a default which is overriden by the book stylesheet, but if the device stylesheet uses !important then it overrides everything. Edit: Allowing for the style-hacks.css (I assume this is added at the start of the book's stylesheet?) and kobo_extra.css (added at the end of the book's stylesheet): 1. device stylesheet 2. style-hacks.css 3. book stylesheet 4. kobo_extra.css 5. style-hacks.css !important 6. book stylesheet !important 7. kobo_extra.css !important 8. device stylesheet !important Last edited by GeoffR; 01-15-2015 at 09:06 PM. Reason: Allowing for ... |
![]() |
![]() |
![]() |
#1197 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
1. device stylesheet 2. book stylesheet 3. style-hacks.css 4. kobo_extra.css 5. book stylesheet !important 6. style-hacks.css !important 7. kobo_extra.css !important 8. device stylesheet !important |
|
![]() |
![]() |
![]() |
#1198 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Yup, right now it's added as the last stylesheet (since I assumed (maybe wrongly) that was roughly equivalent to what happens on kobo's files where that bit of css is inlined at the bottom of the head tag).
IIRC, kobo_extra is a bit more complex, and basically rewrites everything and/or appends itself at the end of *every* stylesheets. On a sidenote, realized why I was confused by the !important thingy in my quick tests: I'd missed a *third* div wrapping the contents of the body in my test book, which of course threw me since I thought it wasn't there ^^ (serves me right for trying to gain a bit of time by reusing an existing thing without checking it more carefully). Thanks for the detailed explanations & references ![]() Last edited by NiLuJe; 01-15-2015 at 10:25 PM. |
![]() |
![]() |
![]() |
#1199 |
Generally Awesome Person
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,100
Karma: 2191133
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
|
Other than !important being the root of all evil, has anyone tried the plugin update and found issues?
|
![]() |
![]() |
![]() |
#1200 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,638
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
I'm still using it and no issues with it till now (the last version without important).
|
![]() |
![]() |
![]() |
Tags |
error, kobo aura one |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kobo Device Driver Update | davidfor | Devices | 284 | 05-24-2019 05:24 PM |
[Device Plugin] Kindle 2, 3, 4, Touch Device Interface MBP Update Mod | cryzed | Plugins | 7 | 10-28-2012 04:58 PM |
[Device Interface Plugin] Update for Nook Color Driver | jmricker | Plugins | 0 | 10-22-2011 10:11 AM |
Touch Kobo Touch Extended 2 Year Warranty - Is it worth the $34.99? | EverC | Kobo Reader | 11 | 08-31-2011 11:47 PM |
Touch Kobo Touch Extended Warranty Program | SensualPoet | Kobo Reader | 1 | 07-17-2011 04:08 AM |