Get all the styles as a string from a given document. useful for creating a PNG from an SVG. SVG’s need to have all of their style information embedded within their document to be properly exported.
Example usage:
var styles = getStyles(window.document);
Try it by going to [http://bl.ocks.org/vicapow/raw/9904319/](this block) and running the above usage example in the console.