cduck/drawsvg

Using style section

ValouBambou opened this issue · 1 comments

I see the append_css method in Drawing, and I want to use it to add some css style in the corresponding section of my generated svg.
The issue that I have is that the generated section is a comment so nothing append and style isn't applied.

<style>/*<![CDATA[*/rectangle {
 stroke: #9ca0b0;
stroke-width: 2;
stroke-opacity: 12;
fill: #ccd0da;
fill-opacity: 12;
font-size: 12;
font-weight: normal;
font-style: normal;
rx: 10;
ry: 10; 
}

text {
 stroke: #4c4f69;
stroke-opacity: 1.0;
fill: #4c4f69;
fill-opacity: 1.0;
font-size: 12;
font-weight: normal;
font-style: normal; 
}/*]]>*/</style>

I don't understand why the format constant in drawing.py is using a comment. Is this a typo ?

Is this the expected behavior of this method ?

I'm dumb style is applied. I'm just terrible at generating valid css and correct class name.