|
![]() |
|
Thread Tools | Search this Thread |
![]() |
#1 |
Connoisseur
![]() Posts: 77
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
|
TOC text is light gray (at least on Kobo), and an unexplained workaround
The Table Of Contents text generated by Sigil looks light colored on the Kobo (Libra 2) ereader. The most obvious solution does not work:
Code:
div.sgc-toc-level-1 a { color:black; } Code:
div.sgc-toc-level-1 a { -webkit-text-fill-color:inherit; } Could this be considered a Kobo bug? If not, perhaps it could be considered to include this "patch" in Sigil? ![]() |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,340
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
How would Sigil ever know that the book is intended for a Kobo in order to include said css? In my mind Sigil is not involved in this at all. I have no idea why it works, or why anything special is needed to see black text in a ToC on a Kobo. *shrug*
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,295
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
By default, Sigil doesn't control the color of the ToC...or any other device/app specific feature. Sigil will create a default sgc-toc.css (and sgc-nav.css for ePub3) but that only includes positioning/structure of the TOC, not color.
Here are the default CSS file(s) created by Sigil. Spoiler:
You can, of course, create your own css styles manually - OR - add a css file (sgc-toc.css) to your Sigil preferences location. You could include your 'patch' from above in that file if you really want to. However, I have a feeling that this is caused either by Kobo not honoring the css or, more likely, by some other CSS in your existing ePub. I would look to see if there is some other styling that is interfering. Use the Inspector tool at the bottom of your preview window to see the CSS affecting your TOC...or do a find:color on your css sheets to see where that is found. Cheers! |
![]() |
![]() |
![]() |
#4 | |
Connoisseur
![]() Posts: 77
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
|
Quote:
Code:
a:-webkit-any-link { color: -webkit-link; cursor: pointer; text-decoration: underline; } I've read that Kobo uses WebKit for their kepub format, which I use. But Sigil doesn't know that I'm going to use a Kobo reader.... |
|
![]() |
![]() |
![]() |
#5 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,945
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
The thing is, using webkit code is not going to work if you want to read as ePub on your Libra 2 or on some other program that's not webkit based.
Figure out how to do it so it works even if webkit isn't used. Webkit code (IMHO) is a crutch. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,295
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
|
|
![]() |
![]() |
![]() |
#7 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,340
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
The other thing to consider is that link text is not supposed to be black.
Last edited by DiapDealer; 08-28-2023 at 11:23 AM. |
![]() |
![]() |
![]() |
#8 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,512
Karma: 167912829
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
I seem to remember that RMSDK uses blue as the link colour by default.
|
![]() |
![]() |
![]() |
#9 | ||||
Connoisseur
![]() Posts: 77
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
|
Thank you all.
Note that I have already found a solution, the issue is that it is somewhat arcane and the most logical solution [div.sgc-toc-level-1 a { color:black; }] does not work on Kobo. Quote:
Quote:
I would like to see the TOC in black text, like when I send the same epub to a Kindle. Quote:
Quote:
This is beyond my limited knowledge, but according to the code inspector, Sigil introduces webkit-related code [a:-webkit-any-link { color: -webkit-link; ...}] in the background and in a non-accessible way. My question is whether, since the blue text looks bad on the e-ink screen, could this code be changed so that the color is black and looks good. |
||||
![]() |
![]() |
![]() |
#10 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,340
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Have you ever played with using a custom css for Sigil's Preview that is stored in its preference directory? Last edited by DiapDealer; 08-28-2023 at 04:52 PM. |
|
![]() |
![]() |
![]() |
#11 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,295
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
The inspector is a read-only display of what css is being applied to the item, and where it is being applied from...or where it might be overridden. You need to go to the actual CSS file, found in the book browser (usually on the left side of the main window) under the "Stylesheets" folder. Double-click on that css file and it will open in the main code view window. Then find the section of code that you were concerned with (a:-webkit-any-link { color: -webkit-link; ...}). Cheers! |
|
![]() |
![]() |
![]() |
#12 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,246
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Quote:
Code:
a:link, a:visited, a:hover, a:active { border-bottom: 1px dotted black !important; color: #696969 !important; } If you're a kobopatch user you could change this override to something you prefer, but as this isn't a discussion which belongs in the Sigil forum I'll leave it at that. |
|
![]() |
![]() |
![]() |
#13 | |
Connoisseur
![]() Posts: 77
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
|
Quote:
I've created a new empty epub, without stylesheet, containing only one line with <h1>Header 1</h1>, then created a TOC and looked at TOC.xhtml with the inspector. This is what I see when I expand <body>, and then <div class="sgc-toc-level-1"> and place the cursor on <a href="Section0001.xhtml">Header 1</a>: Code:
element.style { } user agent stylesheet a:-webkit-any-link { color: -webkit-link; cursor: pointer; text-decoration: underline; } If you get a different result, I would like to know what happens in my case. Sorry for the inconvenience. ![]() |
|
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,340
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'll check when I get a free moment. I suppose it's possible that Preview's QtWebEngine browser could be injecting that particular css, But even if it is, the point is that it's not being saved within the epub itself. Meaning that it can't possibly affect how the epub will look on a different device (Kobo or otherwise). Only the css in the epub (and the device/app's own default css) can effect rendering. The user-agent css cannot follow an epub from device to device/app to app.
The workaround you've discovered is simply using Sigil to add css to the epub itself that overrides the Kobo default css that jackie_w mentioned above. Last edited by DiapDealer; 08-29-2023 at 07:40 AM. |
![]() |
![]() |
![]() |
#15 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,295
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
In your specific epub (not Sigil's or device/app default) you can edit your epub's css sheet. The filename can be different but if it is one created by Sigil's TOC generator it will be called 'sgc-toc.css'. You can add your patch to that specific epub by editing it there. You can then save that file to your Sigil preferences folder and Sigil will automatically use it (with your included patch) every time it makes a new ToC.
Last edited by Turtle91; 08-29-2023 at 07:58 AM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Forma Is there an auto-fix for books having grey background or uses light-gray text? | droopy | Kobo Reader | 78 | 07-13-2020 11:29 AM |
Dropdown menu text is gray on gray (Linux Mint) | droopy | Calibre | 8 | 08-18-2019 09:15 PM |
Troubleshooting text editing workaround for paperwhite | techdummy | Amazon Kindle | 0 | 10-30-2017 12:51 PM |
Glo Partial workaround to make light always-on | markino | Kobo Reader | 7 | 11-27-2012 05:14 AM |
Workaround for clipping text | Prince Hal | Sony Reader | 10 | 03-03-2010 11:53 AM |