jonathantneal / svg4everybody

Use external SVG spritemaps today
https://jonneal.dev/svg4everybody/
Other
3.29k stars 353 forks source link

svg4everybody.legacy.js support range? #118

Closed ghost closed 8 years ago

ghost commented 8 years ago

Does svg4everybody.legacy.js only support IE 6-8 or does it support newer version of IE as well?

For example, if you need support for IE 11 to 6, can you simply include svg4everybody.legacy.js or do you need svg4everybody.js as well for newer browsers?

shawnbot commented 8 years ago

@4Digits The legacy build shivs support for <svg> and <use> elements, and needs to live in the <head> of the document to work with IE6-8. I think that your best bet is to use conditional comments like so:

<head>
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <!--[if lt IE 9]><!-->
  <script src="svg4everbody.legacy.min.js"></script>
  <script>svg4everybody({ /* legacy options */ });</script>
  <!--<![endif]-->
</head>
<body>
  your content
  <!--[if gt IE 8]><!-->
  <script src="svg4everbody.min.js"></script>
  <script>svg4everybody({ /* modern options */ });</script>
  <!--<![endif]-->
</body>
ghost commented 8 years ago

@shawnbot thanks for the info.