06-28-2022, 12:07 PM | #16 |
Grand Sorcerer
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
06-28-2022, 12:50 PM | #17 |
Sigil Developer
Posts: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
|
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> 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. Last edited by KevinH; 06-28-2022 at 12:53 PM. |
06-28-2022, 01:16 PM | #18 | |
Wizard
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
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) */ } 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. |
|
06-28-2022, 01:29 PM | #19 |
Grand Sorcerer
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
You understand this is strictly for aesthetics, right? We're not going to do a ton of work to make a couple of people feel a little warmer and fuzzier about dark Preview. If being able to easily see all portions of the EPUB equally well is important, then most are simply going to turn off Preview's dark appearance on books where colors and/or borders are important. That's what I do.
You clearly don't understand how Preview's dark appearance is achieved (custom_preview_style.css has nothing to do with it), nor how new gui preferences are added. If you did, you'd understand that it's a rather tedious process that touches a lot files and ends with wildly underwhelming results when all is said and done. Not a single bit of it is "all's ya gotta do is blah, blah, blah and Bob's yer uncle!" None of it is hard. Adding more preferences is just time-consuming and unrewarding. I'd rather spend my time elsewhere. Especially when what you want can already be achieved by adding/editing one special css file (a feature we added for this very reason) in Sigil's prefs directory with no Sigil code changes required. Or by just turning off Dark Preview on books that rely heavily on colors/borders. Last edited by DiapDealer; 06-28-2022 at 01:43 PM. |
06-28-2022, 02:29 PM | #20 |
Sigil Developer
Posts: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Yes, I agree with DiapDealer here. It is just not useful enough. If you want that feature, create two different custom_preview_style.css files one with that block of css and one without that (under two different names) and use a os system level shortcut to run a bat file (or bash script) to copy the one you want to custom_preview_style.css. You can do this anytime Sigil is open without hurting anything as that file is read only from Sigil's perspective and is included each time Preview is refreshed.
Much like how I manually change to and from dark mode using macOS Settings now. Sigil options are not needed for this. |
06-28-2022, 02:34 PM | #21 |
Wizard
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Well, if you say is a ton of work, it will be a ton of work, I can't dispute that. But no, I'm not agree with you that is only for aesthetics reasons (as if Sigil wouldn't have any features for aesthetics; just open the Preference/Appearance dialog and you'll see a lot of them; also you can start to think in supressing the command Mend and Prettify to be just Mend, come on!). Thank you very much for your attention and sorry for bother you.
|
06-28-2022, 02:34 PM | #22 |
Wizard
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
06-28-2022, 03:04 PM | #23 |
Sigil Developer
Posts: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
|
It is not a bother, at all.
It is just a "feature" that I think will not benefit that many people, imho. If I am using many colours in a epub's css, then it means the book is limited to light mode or dark mode, not typically both. If meant to be read in light mode (ie. using dark borders) then Previewing it in light mode makes the most sense. The opposite is true for an epub that is meant to be read in dark mode. If an epub is meant to be read under either/both, then the colours must be chosen to work in both modes. And in none of those cases, would inverting colours be needed as Preview would be done in the mode it was designed for. So in many ways, adding invert will just hide the fact that when choosing border colours, you are constraining under what mode the epub can be read in. Sorry. Last edited by KevinH; 06-28-2022 at 03:07 PM. |
06-28-2022, 03:33 PM | #24 |
Grand Sorcerer
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
06-30-2022, 04:57 AM | #25 |
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
I found the problem described by @RbnJrg interesting. I thought it was just a special case that could be solved by the trivial editing of custom_preview_style.css, however, some toggler of custom stylesheets could be a nice addition.
I absolutely do not suggest adding this clunky solution should be added to the release, but it may be useful for two or three people in the world among Sigil users who build the code themselves. An additional advantage is the lack of any changes to the settings – the selected mode works until the Sigil is closed. I also used an existing icon to simplify it. Three-stage toggler works cyclically: a) custom_preview_style.css b) custom_preview_style_invert.css c) disable custom css This is how it works in practice: Code: Spoiler:
|
06-30-2022, 07:33 AM | #26 |
Sigil Developer
Posts: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
|
@BeckyEbook,
Nicely done! Your approach definitely simplifies things and as you said, no additional options are needed for your solution and the Preview toolbar has plenty of room for a single new icon. If we do decide to adopt your solution into master would you be willing to create its own Preview toolbar icon that would indicate what it this tool actually does? And @RbnJrg, would you be willing to add descriptions for it and create and update the Sigil User Guide with those new pieces and of course update all Preview images used in the guide because of the new icon? If so, this is something I would consider adding to master if DiapDealer is okay with it and others feel it would be useful. Last edited by KevinH; 06-30-2022 at 07:39 AM. |
06-30-2022, 08:49 AM | #27 | |
Wizard
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
I definitely think that your improvement should be part of future versions of Sigil because it is pure profit without any drawback. It can be applied not only in my case (which I am looking for inverted colors) but in many other totally different ones (for example, a user might want the text contained in <p> tags are seen in the Preview Panel in one color and the text contained in <div> tags are seen in another color, etc., etc.). And now I think that what you made it could be applied not only for users that work in dark mode but also in users that work in the normal one. Fantastic solution, many, many thanks Becky! |
|
06-30-2022, 08:56 AM | #28 | |
Wizard
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Do it Kevin, it is pure profit without any inconvenience. It can be used not only for my case (that I was looking for inverted colors) but for many others (suppose for example one user would like to preview text in <p> tags in color blue and text in <div> tags [or blockquote tags or whatever] in green to have a better idea of a particular layout).
Quote:
|
|
06-30-2022, 08:59 AM | #29 | |
Grand Sorcerer
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
P.S. I'd like to make sure, however, that it would have the ability to toggle between 3 options (both custom_preview_style.css and custom_preview_style_invert.css exist) and 2 options (only custom_preview_style.css exists), as well as having the button be disabled if none exist. Or some variation thereof. Last edited by DiapDealer; 06-30-2022 at 09:17 AM. |
|
06-30-2022, 11:24 AM | #30 |
Sigil Developer
Posts: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
|
If the selected file does not exist, nothing should be injected so the no custom previews css case should always work.
Hopefully, BeckyEbook can create a new icon that somehow conveys what the icon is used for. Once that happens, I'll add this to master. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Feature requested for Sigil 1.7 | RbnJrg | Sigil | 23 | 08-06-2021 08:44 AM |
Need Feedback on UserDictionaries feature of Sigil | KevinH | Sigil | 11 | 08-29-2020 02:19 PM |
A few Sigil Feature Requests | crankypants | Sigil | 6 | 11-03-2015 09:56 AM |
Parity feature with Sigil | roger64 | Editor | 8 | 03-17-2014 11:28 AM |
Is auto-relinking a Sigil feature? | dlw | Sigil | 2 | 06-27-2011 12:43 AM |