     svg.setAttribute 'xmlns:xlink', XLINKNS
     svg.setAttribute 'version', '1.1'
     #svg.appendChild defs = doc.createElementNS SVGNS, 'defs'
+    ## <style> tags for CSS
+    for style in styles.styles
+      svg.appendChild styleTag = doc.createElementNS SVGNS, 'style'
+      styleTag.textContent = style.css
     ## Look up all symbols in the drawing.
     missing = {}
     @symbols =

      new Context @drawing, i, j

extensionMap =
  '.txt': ASCIIMapping
  '.js': JSMapping
  '.jsx': JSMapping
  '.coffee': CoffeeMapping
  '.cjsx': CoffeeMapping
  '.asc': ASCIIDrawing
  '.ssv': SSVDrawing
  '.csv': CSVDrawing

    svg.setAttributeNS SVGNS, 'height', @height = viewBox[3]
    svg.setAttributeNS SVGNS, 'preserveAspectRatio', 'xMinYMin meet'
    doc
  renderSVG: (mappings, styles) ->
    out = new XMLSerializer().serializeToString @renderSVGDOM mappings, styles
    ## Parsing xlink:href in user's SVG fragments, and then serializing,
    ## can lead to these null namespace definitions.  Remove.
    out = out.replace /\sxmlns:xlink=""/g, ''
