Skip to content
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

dark mode with white images #114

Open
danielweck opened this issue Dec 16, 2021 · 4 comments
Open

dark mode with white images #114

danielweck opened this issue Dec 16, 2021 · 4 comments

Comments

@danielweck
Copy link
Member

danielweck commented Dec 16, 2021

Issue transferred from: edrlab/thorium-reader#1605

Originally posted by @civodulab

Why does the sepia theme change the white of my image ?

Tested on a .png and .jpg image.
Sepia theme
image
Night Theme
image

@danielweck
Copy link
Member Author

CSS reference:

:root:--night-mode img[class*="gaiji"],
:root:--night-mode *[epub\:type~="titlepage"] img:only-child,
:root:--night-mode *[epub|type~="titlepage"] img:only-child {
-webkit-filter: invert(100%);
filter: invert(100%);
}
/* Darken all images on user’s demand */
:root:--night-mode:--darken-filter img {
-webkit-filter: brightness(80%);
filter: brightness(80%);
}
/* Invert all images on user’s demand */
:root:--night-mode:--invert-filter img {
-webkit-filter: invert(100%);
filter: invert(100%);
}
/* Darken and invert on user’s demand */
:root:--night-mode:--darken-filter:--invert-filter img {
-webkit-filter: brightness(80%) invert(100%);
filter: brightness(80%) invert(100%);
}

@civodulab
Copy link

But I need to keep the white of my image in sepia mode. How do I do this?

@mickael-menu
Copy link
Member

A workaround that doesn't involve an update of Readium CSS is to use the day mode (appearance 0) and set the text and background colors manually:

  --RS__backgroundColor: #faf4e8;
  --RS__textColor: #121212;

@JayPanoz
Copy link
Collaborator

Yeah this is caused by the following in sepia mode:

:root:--sepia-mode svg,
:root:--sepia-mode img {
/* Make sure the proper bg-color is used for the blend mode */
background-color: transparent !important;
mix-blend-mode: multiply;
}

At the time mix-blend-mode was added to keep consistent with other apps doing this in sepia mode as well. Maybe we should revisit this decision if authors prefer to keep the background white.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants