Created
December 5, 2019 18:23
-
-
Save martinsvoboda/c50cf2f1961228ff60920aab90f23633 to your computer and use it in GitHub Desktop.
SVG icons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<style> | |
.icon { | |
width: 1.5em; | |
height: 1.5em; | |
stroke: currentColor; | |
stroke-width: 1.5; | |
stroke-linecap: round; | |
stroke-linejoin: round; | |
} | |
</style> | |
<script> | |
(function (doc) { | |
var scripts = doc.getElementsByTagName('script'); | |
var script = scripts[scripts.length - 1]; | |
var xhr = new XMLHttpRequest(); | |
xhr.onload = function () { | |
var div = doc.createElement('div'); | |
div.innerHTML = this.responseText; | |
div.style.width = 0; | |
div.style.height = 0; | |
script.parentNode.insertBefore(div, script) | |
}; | |
xhr.open('get', 'https://citaty.net/static/icons.svg', true); | |
xhr.send() | |
})(document) | |
</script> | |
<svg class="icon"><use xlink:href="#plus"/></svg> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment