02-24-2013, 06:51 PM | #1 |
Member
Posts: 16
Karma: 10
Join Date: Mar 2011
Device: iPad/iPhone
|
iBooks Night Mode Overriding CSS
Is there a way define a CSS stylesheet for an epub viewed on iBooks 3.0 in night mode?
I've tried all the permutations of the Night Vision Style Set Tags as defined in Appendix B found here http://idpf.org/epub/altss-tags/, but with no luck. There are a few black backgrounds defined in the regular stylesheet that I need to set alternate colors for when the iDevice is in night mode. Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"> <head> <meta charset="utf-8" /> <title> SECTION 1 Part B Avionics </title> <link rel="stylesheet" type="text/css" href="css/formatting.css" class="day" title="Day"/> <link rel="alternate stylesheet" type="text/css" href="css/formatting_night.css" class="night"/> </head> <body> ... </body> </html> Regards, Zephyr |
02-25-2013, 02:45 AM | #2 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
As far as I know that is only supported in ePUB3, so you might want to ensure that your ePUB is ePUB3. Then again there is no garantuee it will work. The actual reader has to support it.
There is a developer reference I think, I seem to recall there are links to it in some posts around here. |
Advert | |
|
02-25-2013, 03:22 AM | #3 | ||||
Curmudgeon
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
Quote:
Quote:
Quote:
Quote:
Otherwise... well, there are various copies floating around, all of which seem to be badly out of date. *sigh* |
||||
02-25-2013, 07:01 AM | #4 | |
Resident Curmudgeon
Posts: 76,102
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
02-25-2013, 05:19 PM | #5 |
Member
Posts: 16
Karma: 10
Join Date: Mar 2011
Device: iPad/iPhone
|
I appreciate the feed back.
in addition to not implementing the alternate stylesheets iaw the ipdf spec, iBooks night mode also disregards Code:
background: <color> Code:
!important I've got an email into the iBookstore team, who's referred my questions about night mode to the technical folks. Here's to hoping they have a workaround, or tell me I was just doing it wrong along with an example of how to do it correctly. |
Advert | |
|
02-26-2013, 08:53 AM | #6 |
Resident Curmudgeon
Posts: 76,102
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Night mode is already an override of whatever color is on screen anyway. So it's logical to think it will override your color choices.
|
02-26-2013, 09:13 AM | #7 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
But if there's nothing in the book that sets the colour of the main text, then nothing is overriding anything, and night mode could be applied above or below (in priority) the book styles.
|
02-26-2013, 09:16 AM | #8 |
Resident Curmudgeon
Posts: 76,102
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
A lot of eBooks created from Word documents have the text set as black. So if iBooks didn't override the color choices, then you'd get black on back.
|
02-26-2013, 11:16 AM | #9 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Shame on book creators then. What I mean is that it's not necessary for a "night mode" to override anything. iBooks does? fine then, that's their choice, but it could have been done otherwise. No method is perfect, though, whatever the choice, it will fail in some cases, work in others.
|
02-26-2013, 11:26 AM | #10 |
Member
Posts: 16
Karma: 10
Join Date: Mar 2011
Device: iPad/iPhone
|
As a little background, my epub is completely hand coded with no extraneous coding. Every line, css rule, file has a purpose, and 100% conforms to the ePub 3.0 spec.
|
02-26-2013, 12:54 PM | #11 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
You are in my team then, and you'd probably like an ebook reader that plays nicely with your book. Unfortunately, most ebook readers out there are not designed for well-coded ebooks, but for real-world (often non-compliant) ebooks.
|
02-26-2013, 01:18 PM | #12 | |
Member
Posts: 16
Karma: 10
Join Date: Mar 2011
Device: iPad/iPhone
|
WARNING: Soapbox follows.
Quote:
End soapbox. |
|
02-26-2013, 01:46 PM | #13 |
Resident Curmudgeon
Posts: 76,102
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
02-26-2013, 01:55 PM | #14 |
Member
Posts: 16
Karma: 10
Join Date: Mar 2011
Device: iPad/iPhone
|
|
02-26-2013, 02:01 PM | #15 |
Resident Curmudgeon
Posts: 76,102
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I agree. But with iBooks, what works and what doesn't work can can change from release to release. Say a bug get s fixed that you had a workaround for. That workaround might not work any longer.
|
Tags |
css, epub, ibooks 3, night mode, override |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Odyssey Anyone using Night-Mode? | DuckieTigger | Bookeen | 2 | 01-28-2012 12:13 PM |
help with night mode | golfgirl | Kobo Tablets | 5 | 11-04-2011 10:40 AM |
Overriding CSS ".articledescription" | miwie | Recipes | 6 | 01-18-2011 11:30 AM |
Is there a night mode? | zeroh | Nook Color & Nook Tablet | 5 | 12-04-2010 10:24 AM |