-
Notifications
You must be signed in to change notification settings - Fork 96
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
CSS highlighting in SICP maths book #220
Comments
Related issue: readium/r2-testapp-kotlin#112 |
Hi, ReadiumCSS’ designer there. So I took a quick look this morning and indeed, code isn’t highlighted in night mode (should be in day and sepia though). Reference screenshots: Actually, the absence of code highlighting is to be expected in the r2-swift-testapp, which is using the default Readium-CSS as night mode is an exception. There’s even a closed issue explaining possible issues, complications, etc.: readium/readium-css#7 Overriding
Note we are very aligned with iBooks there, especially:
Which is quite an old CSS trick people have been using to force some colors in iBooks. But once again, I can’t guarantee one or several reading apps won’t create other reading modes (mint, dark blue, dark gray, etc.) in which those forced colors will offer users a very low contrast, making the code snippets very uncomfortable to read. |
Fair enough. Though there actually might be some way to circumvent this, for example, we can calculate luminance difference between background and text color and if it's lower than some user-selectable threshold than increase text luminance. iTerm2 does something like this with its Or we can even invert text color (that is defined by |
Yeah that’s an option but that was out of scope for the ReadiumCSS project: the goal was indeed to have every module constrained to CSS. As a disclaimer, we discussed options a lot during the engineering calls and it was agreed to avoid traversing the DOM (with JS) whenever possible, because that can be very costly in terms of performance. Implementers can however add/remove modules and use some JS logic if they want. Note there’s also another CSS solution, using |
Thanks for explanation! DOM traversal is slow as hell for sure. |
Do we need to keep this issue opened? |
It doesn't seem like we can fix this directly in the Swift projects. Let me know if you want to transfer this issue to |
As far as I can tell after re-reading the issue, there’s not much we can do in Readium CSS either. Even with some hack-ish use of filters, etc. we would get suboptimal results – and that’d be in ideal conditions with proper semantic markup. |
Issue originally reported here:
sarabander/sicp#29 (comment)
@naorunaoru said:
Test EPUB
https://github.com/sarabander/sicp-epub/blob/master/sicp.epub
(see https://github.com/sarabander/sicp )
The text was updated successfully, but these errors were encountered: