View Single Post
Old 01-13-2017, 01:20 PM   #123
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by giddie View Post
Quick question: I've patched my libnickel.so to fix the text-align rule on p and divs. But I haven't been able to find anything that might be responsible for forcing all links to be underlined and blue (well, grey, but I assume blue). I can't get "a" elements to respond to text-decoration or color css properties, even with !important. But it doesn't look like anyone's figured out a patch for it yet either?
Is this for ePub or KePub?

In general,if you have some CSS that does what you want when it is added to the book's stylesheet by Calibre, say by using the kobo_extra.css feature of the KoboTouch driver, then you can create a patch that will add the same CSS to the device's built-in stylesheet. But if You can't do it with Calibre then it is unlikely you will be able to do it with a patch. (Edit: The exception is that a patch can change something that is being forced by the built-in stylesheet.)

Edit: There is this string in libnickel.so.1.0.0:
Code:
a:link, a:visited, a:hover, a:active { border-bottom: 1px dotted black !important; color: #696969 !important; }
I'm not sure in what context it is used, probably somewhere in the KePub stylesheet. Maybe it is the culprit?

Edit: Here is a patch to remove !important from the above CSS in libnickel.so.1.0.0, if you want to test it:
Spoiler:
Code:
<Patch>
patch_name = `test`
patch_enable = `yes`
#
# Removes !important from the following CSS:
#
#  a:link, a:visited, a:hover, a:active { border-bottom: 1px dotted black !important; color: #696969 !important; }
#
find_base_address = `a\0:\0l\0i\0n\0k\0,\0 \0a\0:\0v\0i\0s\0i\0t\0e\0d\0,\0`
replace_string = 008E, `!\0i\0m\0p\0o\0r\0t\0a\0n\0t\0`, ` \0 \0 \0 \0 \0 \0 \0 \0 \0 \0`
replace_string = 00C4, `!\0i\0m\0p\0o\0r\0t\0a\0n\0t\0`, ` \0 \0 \0 \0 \0 \0 \0 \0 \0 \0`
#
</Patch>

Last edited by GeoffR; 01-13-2017 at 01:56 PM. Reason: Here is a patch ...
GeoffR is offline   Reply With Quote