Here is your question rewritten in English with improved phrasing:
I am using draw.io with mkdocs to generate SVG files from .drawio
files. While the SVG generation works fine, I haven’t found a way to match the generated SVG’s theme (light/dark) with my documentation theme.
For instance, consider this drawing:
The generated SVG looks like this:
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1" width="271px" height="81px" viewBox="-0.5 -0.5 271 81">
<defs />
<g>
<g id="cell-KvmMxyJyz-GtX_r3PUmK-3">
<path d="M 80 40 L 183.63 40" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10"
pointer-events="stroke" />
<path d="M 188.88 40 L 181.88 43.5 L 183.63 40 L 181.88 36.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)"
stroke-miterlimit="10" pointer-events="all" />
</g>
<g id="cell-KvmMxyJyz-GtX_r3PUmK-1">
<rect x="0" y="0" width="80" height="80" rx="12" ry="12" fill="#ffe6cc" stroke="#d79b00"
pointer-events="all" />
</g>
<g id="cell-KvmMxyJyz-GtX_r3PUmK-2">
<ellipse cx="230" cy="40" rx="40" ry="40" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all" />
</g>
</g>
</svg>
As you can see, the shapes have hardcoded styles like fill="#ffe6cc"
and stroke="#d79b00"
.
When embedding the SVG directly in HTML, for instance with Bootstrap, I could use theme colors instead by using classes such as class="--bs-primary"
.
Is there a way to define a CSS style for a drawing in draw.io and have all shapes refer to these defined styles, rather than having hardcoded styles?