jellyfin-web icon indicating copy to clipboard operation
jellyfin-web copied to clipboard

EPUBs are not readable with new dark mode

Open thornbill opened this issue 1 year ago • 1 comments

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

  1. Open the EPUB player within Jellyfin

Expected Behavior Book text should be legible. We should either:

  1. Use epub.js theme support to render in dark mode correctly.
  2. 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 Screenshot 2022-09-21 at 14-10-57 Jellyfin

System (please complete the following information):

  • Platform: Any
  • Browser: Any
  • Jellyfin Version: Unstable

Additional Context

thornbill avatar Sep 21 '22 18:09 thornbill

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.

carif avatar Sep 21 '22 19:09 carif