-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use darker font color on e-ink devices (Kindle Paperwhite) #67
Comments
I've also heard several complaints that the text color is too light, so I'm definitely willing to change the default. It's currently set to The way to override the styles at the moment is to provide a custom epub3.css file, which I realize is a bit heavy. |
Screenshots would really help here. |
The real problem seems to be non-color devices (which don't show gray the same). We could set the color to an even dark black on those devices by using a CSS3 media query. See https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries#Media_features |
Black is just horrible when displayed on a LCD with a fluorescent backlight (any color device). |
@mojavelinux You were asking for picture. One of the reader complaining of the too light grey on his Kindle provided a picture: |
Yep, I saw that after I posted. Hopefully the reader will be willing to
post an "after" picture as well so we can see the difference.
|
For the record, the workaround is:
With this it should display fine on Paperwhite for example. |
The Paperwhite already solves the problem at the hardware level of pure black being hard/harsh to read. We don't need to help it (because then the text becomes too dim). The reason we use the dark gray is to fix over-saturation on color devices (like the Kindle Fire). We should use a media query to detect this scenario and apply the appropriate styles. |
We'll need to run a test like the one described in this article to see what matches for the Paperwhite so we know what media query to use. |
(when I say Paperwhite, I'm referring to all devices like it, including the Kobo). |
Very nice! Thanks for the follow-up @clacote. I have a solid understanding of the issue at hand now. |
I keep wanting to fix this issue by using a monochrome media query. Sadly, the device that media query doesn't work on is the Kindle Paperwhite :( It looks like to fix this in core (and still use dark gray for color devices) we have to use media queries based on screen sizes. (Honestly, what is this world coming to?) For details, see https://medium.com/@sandersk/responsive-ebook-design-a-primer-8bba01328219#7be5. Something like: /* Use dark fonts on Kindle Paperwhite */
@media amzn-kf8 and (device-height: 1024px) and (device-width: 758px) {
body p,
body a:link,
ul, ol, li, dl, dt, dd, footer,
div.verse .attribution, table.table th, table.table td,
figcaption, caption,
h1, h2, h3, h4, h5 {
color: #000000;
}
body a:link {
-webkit-text-fill-color: #000000;
}
.chapter-header {
background-color: #191918;
}
} I don't have a Kindle Paperwhite, so I'd need someone to verify this proposal works both in portrait and landscape mode. |
I just tested this on two Kindle Paperwhites from 2012 and 2014, and it works just fine in portrait mode. To get it to work in landscape, as well, I had to change the query like this: @media amzn-kf8 and (device-height: 1024px) and (device-width: 758px),
amzn-kf8 and (device-height: 758px) and (device-width: 1024px) {
/* ... */
} Furthermore, I also included (Before, the gray looked kind of washed out, like a bleached photocopy. Not pleasant to read!) So, in my opinion, a must-have for the current style sheet! 😉 👍 EDIT: Here is another useful website where media queries for the Kindle are being discussed, for reference. http://epubsecrets.com/media-queries-for-kindle-devices.php |
If you want, I can send you a pull request — but it's really just a matter of copying the code from above into the style sheet. Just let me know how you'd like to do it! 😄 |
I'll go ahead and apply these changes for alpha.8 so you can test. Here's what I'm going to add: /* Use darker font colors on Kindle Paperwhite */
@media amzn-kf8 and (device-height: 1024px) and (device-width: 758px),
amzn-kf8 and (device-height: 758px) and (device-width: 1024px) {
body p,
div.abstract > p,
ul, ol, li, dl, dt, dd, footer,
div.verse .attribution, table.table th, table.table td,
figcaption, caption,
h1, h2, h3, h4, h5 {
color: #000000;
}
body a:link,
div.abstract > p a:link {
color: #000000;
-webkit-text-fill-color: #000000;
}
body a:visited {
color: #333332;
-webkit-text-fill-color: #333332;
}
.chapter-header {
color: #191918;
border-bottom-color: #191918;
}
h1.chapter-title .subtitle {
color: #000000;
}
.chapter-header p.byline {
color: #191918;
}
} |
- detect Kindle Paperwhite using kf8 + resolution media query - force darker colors on Kindle Paperwhite
Even if we miss something on this update, it will be easy to add additional overrides in the future. |
Here's the related PR: #160 |
@mojavelinux Great! I'm ready to give it a try as soon the release is out. |
The release is now available! |
@mojavelinux I tested it, and it fixes the issue on Kindle \o/ |
We just need a way to identify Kobo monochrome using a media query and we
can apply the same rules.
…On Feb 22, 2018 06:48, "Cédric Exbrayat" ***@***.***> wrote:
@mojavelinux <https://github.com/mojavelinux> I tested it, and it fixes
the issue on Kindle \o/
But I still have the problem on a Kobo...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#67 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAE191smJVRTtOZQS-cUd5Ncfr2B9Dfeks5tXXA-gaJpZM4HL2-s>
.
|
Just tried it out on a Kindle, and it works great! Thanks a lot for all your efforts, Dan! |
@mojavelinux Do you have any idea about what we could use to identify Kobo monochrome? |
No idea. I don't have one, so I have no way to check. Perhaps we can crowd source it to see if we can find someone willing to experiment/test. |
I've got one, but I don't know what to test :) I was hoping you would know about a |
Welcome to epub development. There are no specs for any of this, so it's usually Google + trial and error. |
Sometimes the epub test suite is helpful. http://www.epubtest.org/testsuite/epub3/ |
Kobo provides a pretty useful guide, but no mention of media queries. |
You could file an issue there and see if they respond. |
@Casacove Is there a specific question you have regarding Asciidoctor EPUB3? This is not a support forum for Kindle devices. All we can control is what content is included and to a certain degree the layout and styling of text. |
Unfortunately, newer Paperwhite models (possibly others) are still affected by this due to their higher resolution screen not being covered by the media query. |
Since ebook readers refuse to honor the CSS properly, we can't have nice things. At this point, I would support just going to full black. Simpler is better. Please file a new issue and I'm sure @slonopotamus will consider it. |
According to Wikipedia, Kindle Oasis has a definition of 1680 × 1264 pixels, 300 ppi. And according to asciidoctor#67, we can only detect the model of kindle by its definition. We just apply the same recipe as for PaperWhite here.
According to Wikipedia, Kindle Oasis has a definition of 1680 × 1264 pixels, 300 ppi. And according to #67, we can only detect the model of kindle by its definition. We just apply the same recipe as for PaperWhite here.
We just released our ebook, and some readers have been complaining about our font (on Kindle and Kobo) that is too light.
It is indeed a light gray, and we were wondering if there is an easy way to customize the font color for something a bit darker.
Going over the docs, I did not find what would be the best way and my attempt has not yield any result.
Do we need to have a custom
epub3.css
file?Can I just overwrite the font color, or do I need to take the whole existing
epub3.css
content?The text was updated successfully, but these errors were encountered: