View Single Post
Old 05-08-2021, 05:49 AM   #1
Jim101
Junior Member
Jim101 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: May 2021
Device: PC
Setting SVG image styles via CSS.

I've been experimenting with setting the styles in an SVG image via a style sheet. The attached EPUB is hopefully self-explanatory. It contains 4 cases, starting with setting SVG styles via SVG presentation attributes and gradually working towards setting the styles with CSS and eventually separating them out to the EPUB's style sheet.

The first 3 cases behave as expected. Case 4 is broken. This might be due to a bug in Sigil, but I'm new at coding EPUB documents, so it's far more likely that I've made an error in the coding. But after a week of staring at my code, I'm not making any progress. Can anyone spot my error?

Incidentally, the comment that the first 3 cases behave as expected is true when viewing the EPUB in Sigil, Calibre and Gnome Books. Curiously, FBReader and Sumatra were unable to display any of the 4 SVG images, and Okular only managed to partially display some of them. I'm not sure whether that is due to me making a coding error that caused them to choke, or limitations of those apps.
Attached Files
File Type: epub sigil_expt_v2.epub (5.3 KB, 296 views)
Jim101 is offline   Reply With Quote