class_docstr: Svg related methods
class_docstr_tok: ["Svg","related","methods"]
docstr: Add the css to the svg
docstr_tok: ["Add","the","css","to","the","svg"]
code: def add_styles(self):
      """Add the css to the svg"""
      colors = self.graph.style.get_colors(self.id, self.graph._order)
      strokes = self.get_strokes()
      all_css = []
      auto_css = ["file://base.css"]
  
      if self.graph.style._google_fonts:
          auto_css.append(
              "//fonts.googleapis.com/css?family=%s"
              % quote_plus("|".join(self.graph.style._google_fonts))
          )
  
      for css in auto_css + list(self.graph.css):
          css_text = None
          if css.startswith("inline:"):
              css_text = css[len("inline:") :]
          elif css.startswith("file://"):
              css = css[len("file://") :]
  
              if not os.path.exists(css):
                  css = os.path.join(
                      os.path.dirname(__file__), "css", css
                  )
  
              with io.open(css, encoding="utf-8") as f:
                  css_text = template(
                      f.read(),
                      style=self.graph.style,
                      colors=colors,
                      strokes=strokes,
                      id=self.id,
                  )
  
          if css_text is not None:
              if not self.graph.pretty_print:
                  css_text = minify_css(css_text)
              all_css.append(css_text)
          else:
              if css.startswith("//") and self.graph.force_uri_protocol:
                  css = "%s:%s" % (self.graph.force_uri_protocol, css)
              self.processing_instructions.append(
                  etree.PI("xml-stylesheet", 'href="%s"' % css)
              )
      self.node(self.defs, "style", type="text/css").text = "\n".join(
          all_css
      )
  
imports: from __future__ import division
  import io
  import json
  import os
  from datetime import date, datetime
  from math import pi
  from numbers import Number
  from urllib.parse import quote_plus
  from pygal import __version__
  from pygal.etree import etree
  from pygal.util import coord_abs_project, coord_diff, coord_dual, coord_format, coord_project, minify_css, template
label_desc: Use image node_id 2 for calling the Svg obj's underlying member method code with example usage: obj.add_styles() without return types