<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 25 août 2020 à 06:51, James Cameron <<a href="mailto:quozl@laptop.org">quozl@laptop.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
To help answer that, I've prepared a fork of Hello World with the<br>
sugar3.graphics.icon module inline.<br>
<br>
<a href="https://github.com/sugarlabs/hello-world/tree/test-svg-css" rel="noreferrer" target="_blank">https://github.com/sugarlabs/hello-world/tree/test-svg-css</a><br>
<br></blockquote><div><br></div><div>Nice!<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Next, I need a sample SVG file with CSS file in the form you plan to<br>
use.<br>
<br></blockquote><div><br></div><div>You could find at set of new icons here: <a href="https://github.com/llaske/svgstudy/tree/master/icons/new">https://github.com/llaske/svgstudy/tree/master/icons/new</a> <br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I'm not sure what the next step is, but perhaps Rsvg library has code<br>
already to do this.<br>
<br>
I've tried with an SVG external source, but the test fails to render.<br>
<br>
<a href="https://github.com/sugarlabs/hello-world/tree/test-svg-css-external-source" rel="noreferrer" target="_blank">https://github.com/sugarlabs/hello-world/tree/test-svg-css-external-source</a><br>
</blockquote><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Perhaps I need to set the base uri.<br>
<br></blockquote><div><br></div><div>Hmmm. Are you sure you should not define a <symbol id="myid"> tag in the SVG file and reference #myid in the <use> tag?</div><div>It's the way I'm doing. See in my test page here:</div><a href="https://github.com/llaske/svgstudy/blob/master/icons/new/abcd-icon2.svg?short_path=f320e6c#L17">https://github.com/llaske/svgstudy/blob/master/icons/new/abcd-icon2.svg?short_path=f320e6c#L17</a></div><div class="gmail_quote"><a href="https://github.com/llaske/svgstudy/blob/master/test.html#L355">https://github.com/llaske/svgstudy/blob/master/test.html#L355</a><div><div><br></div><div>BTW I think it's better to do this step by step: <br></div><div>- Use CSS variables with a CSS style sheet<br></div><div>- Then once it works, try to use SVG external source</div><div><br></div><div> </div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<a href="https://lazka.github.io/pgi-docs/#Rsvg-2.0/classes/Handle.html%23Rsvg.Handle" rel="noreferrer" target="_blank">https://lazka.github.io/pgi-docs/#Rsvg-2.0/classes/Handle.html#Rsvg.Handle</a><br>
<br>
There is a new set_stylesheet function in Rsvg 2.48 we might use, if<br>
the Python bindings actually work.<br></blockquote><div><br></div><div>Yes, it seems to do the job.</div><div><br></div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Interesting, thanks. I've not used Inkscape seriously yet. I had<br>
thought the original SVG files should be kept separate to the<br>
transformed files.<br>
<br></blockquote><div><br></div><div>No, it's better to have only one file to maintain.</div><div><br></div><div>Regards.</div><div><br></div><div> Lionel</div><div><br></div><br></div></div>