Closed samizdatco closed 2 years ago
While SwiftDraw probably can't full support all selectors (e.g. descendents) within stylesheets, would it be useful if a small subset were supported? Simple class and element matching (stylesheet.svg) is probably simple enough to implement.
The use case I have in mind is being able to work with SVG produced by Illustrator, Figma, and the like. As far as I can tell, the embedded stylesheets they produce don't get any fancier than using class- and id-based selectors. So the subset you're considering seems like it would be a huge compatibility boost.
Great, I will look to implement this in the next version.
At the moment SwiftDraw only seems to support style attributes that are set directly on SVG elements. Many tools create SVG files with an embedded stylesheet and rely on the style cascade to apply them to the elements. I can imagine this would be a significant undertaking, but it would be a great compatibility improvement if both types of files could be rendered.
For instance, here are two 'identical' SVGs that differ only in terms of where their styles live:
SwiftDraw produces very different output when rendering them though: