jellyfin-web
jellyfin-web copied to clipboard
EPUBs are not readable with new dark mode
Describe The Bug EPUBs seem to render with black text on a dark background by default since https://github.com/jellyfin/jellyfin-web/pull/3855 was merged.
Steps To Reproduce
- Open the EPUB player within Jellyfin
Expected Behavior Book text should be legible. We should either:
- Use epub.js theme support to render in dark mode correctly.
- Force a light background for the EPUB reader.
Preferably we should use epub.js themes in my opinion. I have not found much documentation for that though.
Logs N/A
Screenshots
System (please complete the following information):
- Platform: Any
- Browser: Any
- Jellyfin Version: Unstable
Additional Context
Oh.
Preferably we should use epub.js themes in my opinion. I have not found much documentation for that though.
I think the only documentation is that example here. It just registers some css file. I'm not sure how this would be implemented in Jellyfin, but I guess when Jellyfin changes the theme, epubjs needs to be somehow informed of that change.
Based on that, we need to do something like:
// register css themes with epubjs..
// pls mind that this code causes "MIME type (“text/html”) mismatch" that needs to be fixed (idk how)
rendition.themes.register('dark', 'style.scss');
rendition.themes.register('light', 'style.scss');
// somehow select the theme based on which theme jellyfin uses
rendition.themes.select('dark');
Using style.scss
assumes that someone puts a proper light and dark theme into there. When setting the background
css value, epubjs will only style the book, not any other background that might exists there.