Skip to content

Instantly share code, notes, and snippets.

@allusis
Created September 15, 2017 14:57
Show Gist options
  • Save allusis/081e01ca09611758e25bb4cd4bd4be56 to your computer and use it in GitHub Desktop.
Save allusis/081e01ca09611758e25bb4cd4bd4be56 to your computer and use it in GitHub Desktop.
SVG Sprites In Visualforce
<c:sprite />
<!-- xmlns is needed at the top-most page element -->
<div xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg class="icon stroke">
<use xlink:href="#home"></use>
</svg>
</div>
<apex:component layout="none">
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
<defs>
<symbol id="home" viewBox="0 0 32 32">
<polyline data-cap="butt" fill="none" stroke-width="2" stroke-miterlimit="10" points="5,12.4 5,30 13,30 13,22 19,22 19,30 27,30 27,12.4 " stroke-linejoin="miter" stroke-linecap="butt"></polyline>
<polyline fill="none" stroke-width="2" stroke-linecap="square" stroke-miterlimit="10" points=" 2,15 16,3 30,15 " stroke-linejoin="miter"></polyline>
<rect x="13" y="12" fill="none" stroke-width="2" stroke-linecap="square" stroke-miterlimit="10" width="6" height="5" stroke-linejoin="miter"></rect>
</symbol>
</defs>
</svg>
</apex>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment