Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 02-24-2013, 07: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, 03: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: 3,183
Karma: 7180223
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
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
 
Advertisement
Old 02-25-2013, 04: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.
 
Posts: 313
Karma: 1028382
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, 08: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: 38,549
Karma: 19637653
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 1, iPhone 5
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 online now   Reply With Quote
Old 02-25-2013, 06: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, 09: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: 38,549
Karma: 19637653
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 1, iPhone 5
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 online now   Reply With Quote
Old 02-26-2013, 10: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: 6,316
Karma: 4963983
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, 10: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: 38,549
Karma: 19637653
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 1, iPhone 5
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 online now   Reply With Quote
Old 02-26-2013, 12:16 PM   #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: 6,316
Karma: 4963983
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, 12:26 PM   #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, 01: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: 6,316
Karma: 4963983
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, 02: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, 02: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: 38,549
Karma: 19637653
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 1, iPhone 5
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 online now   Reply With Quote
Old 02-26-2013, 02: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, 03: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: 38,549
Karma: 19637653
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 1, iPhone 5
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 online now   Reply With Quote
Reply

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Odyssey Anyone using Night-Mode? DuckieTigger Bookeen 2 01-28-2012 01:13 PM
help with night mode golfgirl Kobo Tablets 5 11-04-2011 11:40 AM
Overriding CSS ".articledescription" miwie Recipes 6 01-18-2011 12:30 PM
Is there a night mode? zeroh Nook Color & Nook Tablet 5 12-04-2010 11:24 AM


All times are GMT -4. The time now is 08:23 PM.


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