Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 02-24-2013, 06:51 PM   #1
zephyrmays
Member
zephyrmays began at the beginning.
 
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>
Also, is there any developer reference for Apple's iBooks? I cannot find much documentation...

Regards,

Zephyr
zephyrmays is offline   Reply With Quote
Old 02-25-2013, 02:45 AM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
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.
Toxaris is offline   Reply With Quote
Old 02-25-2013, 03:22 AM   #3
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by zephyrmays View Post
Is there a way define a CSS stylesheet for an epub viewed on iBooks 3.0 in night mode?
I don't think so; night mode is just like any other set of reader style overrides; as a rule, you pretty much have to assume that the reader is going to override certain styles when people specify those modes, and make sure that text doesn't suddenly become invisible with judicious use of !important.



Quote:
Originally Posted by zephyrmays View Post
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.
It might be worth filing a feature request bug over at bugreport.apple.com. It requires you to create a free developer account.


Quote:
Originally Posted by zephyrmays View Post
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.
You could always do something subtle like setting the background to #101010 or something so that it looks basically like black in normal mode, but looks like a dark grey in night mode.


Quote:
Originally Posted by zephyrmays View Post
Also, is there any developer reference for Apple's iBooks? I cannot find much documentation...
If you decide to distribute through the iBookstore, then yes. After you sign up for an iTunes Connect account (http://www.apple.com/itunes/content-.../book-faq.html), you should gain access to the iBookstore Asset Guide.

Otherwise... well, there are various copies floating around, all of which seem to be badly out of date. *sigh*
dgatwood is offline   Reply With Quote
Old 02-25-2013, 07:01 AM   #4
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: 73,931
Karma: 128903250
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 zephyrmays View Post
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.
This is not a bug. It's Apple doing things their way. A lot of iBooks is non-standard. Filing a bug report is going to be a waste of your time.
JSWolf is offline   Reply With Quote
Old 02-25-2013, 05:19 PM   #5
zephyrmays
Member
zephyrmays began at the beginning.
 
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>
and
Code:
!important
statements.

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.
zephyrmays is offline   Reply With Quote
Old 02-26-2013, 08:53 AM   #6
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: 73,931
Karma: 128903250
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.
JSWolf is offline   Reply With Quote
Old 02-26-2013, 09:13 AM   #7
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by JSWolf View Post
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.
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.
Jellby is offline   Reply With Quote
Old 02-26-2013, 09:16 AM   #8
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: 73,931
Karma: 128903250
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 Jellby View Post
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.
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.
JSWolf is offline   Reply With Quote
Old 02-26-2013, 11:16 AM   #9
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
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.
Jellby is offline   Reply With Quote
Old 02-26-2013, 11:26 AM   #10
zephyrmays
Member
zephyrmays began at the beginning.
 
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.
zephyrmays is offline   Reply With Quote
Old 02-26-2013, 12:54 PM   #11
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
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.
Jellby is offline   Reply With Quote
Old 02-26-2013, 01:18 PM   #12
zephyrmays
Member
zephyrmays began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Mar 2011
Device: iPad/iPhone
WARNING: Soapbox follows.

Quote:
Originally Posted by Jellby View Post
Unfortunately, most ebook readers out there are not designed for well-coded ebooks, but for real-world (often non-compliant) ebooks.
And that is the worst part. I understand e-readers (hardware and software) are limited by the design choices their creators make, but at least publish what those limitations are, what parts of the spec are supported, and fully disclose the proprietary features and behaviors (and how to use them!) so we as authors can target our content take full advantage of each platform.

End soapbox.
zephyrmays is offline   Reply With Quote
Old 02-26-2013, 01:46 PM   #13
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: 73,931
Karma: 128903250
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 zephyrmays View Post
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.
But, iBooks does not conform 100% to any ePub spec.
JSWolf is offline   Reply With Quote
Old 02-26-2013, 01:55 PM   #14
zephyrmays
Member
zephyrmays began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Mar 2011
Device: iPad/iPhone
Quote:
Originally Posted by JSWolf View Post
But, iBooks does not conform 100% to any ePub spec.
I understand that, but see my comment above. It would be nice to have some guidance about what is and isn't supported from the e-reader makers.
zephyrmays is offline   Reply With Quote
Old 02-26-2013, 02:01 PM   #15
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: 73,931
Karma: 128903250
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 zephyrmays View Post
I understand that, but see my comment above. It would be nice to have some guidance about what is and isn't supported from the e-reader makers.
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.
JSWolf is offline   Reply With Quote
Reply

Tags
css, epub, ibooks 3, night mode, override


Forum Jump

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


All times are GMT -4. The time now is 11:02 PM.


MobileRead.com is a privately owned, operated and funded community.