Last active
October 21, 2022 15:23
-
-
Save blokhin/7c86a684b66786277da16620dab9f99e to your computer and use it in GitHub Desktop.
Embed SVG into CSS style with JavaScript
This file contains 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
dom_el.style.backgroundImage = `url("data:image/svg+xml;utf8,<svg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'><circle cx='50' cy='50' r='` + value + `' fill='%2399f' /></svg>")`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment