Converts an SVG string to data url. This is useful for creating images from SVGs, or using SVGs in CSS. To use put in template string: url(${svgUrl\...`})`
url(${svgUrl\
template strings
Rest
template values
const url = svgUrl\` <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> ... </svg>\`console.log(url) // data:image/svg+xml;charset=UTF-8,... Copy
const url = svgUrl\` <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> ... </svg>\`console.log(url) // data:image/svg+xml;charset=UTF-8,...
Converts an SVG string to data url. This is useful for creating images from SVGs, or using SVGs in CSS. To use put in template string:
url(${svgUrl\
`})`