View Single Post
Old 02-20-2025, 09:48 AM   #1
qntnlq
Junior Member
qntnlq began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2025
Location: Somewhere on the eastern side of the land of the baguette
Device: Pocketbook Era
Having a SVG match the text color

Hello everyone,

Probably a noob question. Sorry about that.

I am trying to create an epub from texts found on the internet, and some chapters feature a divider, which I reproduced as an svg.
On Sigil, I can import it and use it as an image but here's the catch : I want to make it the same colour as the text (so that someone who would want to read with a different colour scheme can have a more consistent experience).

I am aware I can use "fill:currentColor", but I can't get things to work how I want them to :
  • Either I import the svg as an image, and then the fill doesn't cascade to the svg, and the image stays in black ;
  • Either I copy-paste the full svg code in the html file, and things work but my code becomes a nightmare (and it is probably inefficent) ;
  • Either I try to use (probably very badly) an href in my <use> with a , but then nothing happens.

Here's the coding situation :

This is quite infuriating and I'm out of ideas...

Hence my question : do you know a way to import an svg that will keep the current Color attribute ?
I feel like the <use> stuff could help but I must misundertand how the element works...

Anyway, thanks in advance, and have a wonderful day !


EDIT : Huh. The imgur link doesn't display the image... Here's the link
https://imgur.com/a/im-so-very-bad-epubing-ilVXkOG
qntnlq is offline   Reply With Quote