View Single Post
Old 06-28-2022, 01:16 PM   #18
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,834
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by KevinH View Post
And unfortunately, that invert impacts image / pngs and inverts their colour to make things look very very strange.

Instead, you can assign a Sigil clip that pastes:

Code:
  <style>
    body {
      background-color: initial !important;
      color: initial !important;
      filter: invert(1);
    }  
  </style>
into the head tag of any single xhtml page, or alternatively pastes a simpler clip added to any css file. So you can enable this when needed all with a single click on its clip, and even remove it with a single click using a Saved Search Find and Replace.

So adding an option to do this is probably not worthwhile especially given its potentially negative impact on images and issues with linux.

Try creating it as a clip and building a saved search to easily remove them. That should be be doable.
That is NOT a solution, because it will affect not only PP but the epub itself. Regarding images, is very easy to solve that, for example, by adding (so far) in custom_preview_style.css the following:

Code:
body {
    background-color: initial !important;
    color: initial !important;
    filter: invert(1); 
}

svg, img {
    filter: invert(1);    /* This is ok, it must be invert(1) and not invert(0) */
}
Now you'll have images with original colors and the rest, with inverted colors (do the try and you'll see; by the way, with line art images, it could be and advantage to have images inverted in dark mode).

How does Sigil handle the styles added in custom_preview_style.css? The only thing you should do to add the option is to modify that sheet in order to incorporate the selectors (also you can use classes and/or ids) and styles I wrote before and after that, refresh the PP. And when the option is disabled, erase selectors and styles and again, refresh PP. For a programmer of your carats, that is a piece of cake. And after that, user will be able to see black border, table-borders, and similars, in dark mode.
RbnJrg is offline   Reply With Quote