Inline the styles to be styling attributes when generating standalone SVG
See original GitHub issueMight be useful to allow generating a standalone SVG document - #35 requested it. Right now I just generate an <svg>
suitable for inserting into an HTML doc.
Just need to output the <svg>
with the right namespace decls, and inline the style.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:7
- Comments:11 (9 by maintainers)
Top Results From Across the Web
Styling – SVG 1.1 (Second Edition)
Styling properties can be assigned using SVG's presentation attributes. For each styling property defined in this specification, there is a corresponding XML ...
Read more ><style> - SVG: Scalable Vector Graphics - MDN Web Docs
The SVG <style> element allows style sheets to be embedded directly within SVG content. Note: SVG's style element has the same attributes as...
Read more >How to Style Scalable Vector Graphics Using CSS
Instead of attributes, you can use inline styles with identical property names: ... Creating the SitePoint Logo as a CSS-Styled SVG.
Read more >How do I create a style sheet for an SVG element?
Use an (X)HTML style element. If your SVG code is inline within an (X)HTML document, then the HTML <style> element can be used...
Read more >Does not convert CSS attributes to XML attributes ... - GitLab
svg ). According to tooltip "Convert styles from style tags and inline style='' declarations into XML attributes." I would expect the behaviour ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Okay, so an alternative approach: since my styling isn’t complicated in the first place, I can replace it with a few “fake selectors”, targetting each of the objects. So you’d specify it something like:
Then, if generating standalone, I can walk the graph and set attributes appropriately; otherwise, I can turn this into a stylesheet and append that, as appropriate.
The “standalone” diagrams generated by the online dingus still just display as black boxes when opened in Inkscape or Gnome’s Image Viewer? 😕