| CSS: Detection & Style (Day vs Sepia vs Night) | Bryce Otis | 13/11/14 12:25 | This post is somewhat duplicated on Apple's Forums The behavior may be different, but the questions are the same Results are based on iBooks 4.1, iOS 8.1, iPhone 5 Sorry, don't have an Android device to test with... I'm having difficulty locating instructions on how to modify CSS for the three viewing modes. The only example I could find used @media, but either I don't have the correct element names, or I have some other syntax error, or I should be using some other mechanism to change styles?
Is it even possible for an ePub to detect these modes since it may be at the application level?
Is it possible to do this within one CSS file or would it require:
If so, what mechanism would be used to switch between them?
I notice that iBooks has the same feature except Day is called White, would the calls/tags be the same, or would I need to also make a White.css?
Using the CSS file below:
Would it be possible to use something akin to a light mask to auto adjust color levels? i.e. #003300 on a White background would switch to #ffccff on a Black background? equation: (#000000 + 003300) ≈ (#ffffff − 003300) is the same Relative % Green
I realize this 'Black & White' night mode may be a feature and not a bug, but this reminds me of IE vs FF all over again... <!DOCTYPE html> |
| Re: CSS: Detection & Style (Day vs Sepia vs Night) | Bryce Otis | 13/11/14 15:01 | Ugh, logic kicks in:
|
| Re: CSS: Detection & Style (Day vs Sepia vs Night) | Garth Conboy | 14/11/14 07:39 | Hello Bryce, That is, indeed, an interesting idea. Do note that there is a nod to styling for various presentation modes in the EPUB 3 standard: http://www.idpf.org/epub/301/spec/epub-contentdocs.html#sec-xhtml-alternate-style-tags It likely this direction will gain popularity when more widely supported. Google Play Books currently supports horizontal/vertical, not yet day/night. But, hopefully that won't always be the case. Best, Garth |
| Re: CSS: Detection & Style (Day vs Sepia vs Night) | Bryce Otis | 26/11/14 12:53 | The goal is to write one ePUB that behaves the same regardless of UA This is how I currently understand Stylesheet mechanics: The
W3C method: (ePaper devices & non-Color printers may have their own
Grayscale conversion, but this allows Filters to be matched to Themes)
Observation: Trident shows all five PREFERED choices, while Gecko seems to validate screen="color" so it only shows three. The WebKit method:
The vast majority of mobile eReading devices are: Android (B&N Nook, Kindle Fire, etc.), or iOS (iPad, iPhone, iPod Touch) The part I am fuzzy on is, how to match Themes with WebKit's Validation model, if I'm even using the correct terminology... An analogy would be how Filters load from CSS:
Where: (iBooks) Validator [adaptivegarage's example]
|