svgconstant
The flag of Soviet Union (ソビエト連邦), SUHH, as an SVG string: viewBox 1200 by 600 (2:1), 1.2 KB. From Wikimedia Commons, "Flag of the Soviet Union.svg" (public domain); the /manifest entry gives its author, licence and why it was chosen. It has a viewBox and no width or height, so it fills the box it is put in at its own aspect ratio.
Import it
import { svg } from "@johnmorrisdotca/hata/flags/suhh";
Definition
const svg: string = "<svg data-hata=\"suhh\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1200 600\"><path fill=\"#bc0000\" d=\"M0 0h1200v600H0z\" style=\"fill:#c00;fill-opacity:1\"/><path d=\"m200 38-8 25h-28l22 16-8 26 22-16 22 16-8-26 22-16h-28zm0 13 5 17h18l-14 10 5 16-14-10-14 10 5-16-14-10h18z\" style=\"fill:gold;fill-opacity:1;stroke:none;stroke-width:.14999977px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/><g style=\"fill:gold;fill-opacity:1\"><path d=\"m137 172 19 19 18-18 82 86a10 10 0 0 0 15-14l-86-82 23-24-33-5z\" style=\"fill:gold;fill-opacity:1;stroke:none;stroke-width:.48919073;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1\" transform=\"matrix(0.98931879,0,0,0.98673811,3.8297658,3.7659398)\"/><path d=\"M198 110q24 14 35 35 10 21 10 38a41 41 0 0 1-72 27l-4 4a6 6 0 0 0-7 2q-5 0-7 5a27 27 0 0 1-15 14l-9 5q-8 9-6 17a4 4 0 0 0 5 5q8 1 16-7l6-9a27 27 0 0 1 14-15q4-2 4-6 16 19 41 19c30 1 52-21 53-52 1-16-6-37-20-54a88 88 0 0 0-44-28\" style=\"fill:gold;fill-opacity:1;stroke:none;stroke-width:.50003481;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1\" transform=\"matrix(0.98931879,0,0,0.98673811,3.8297658,3.7659398)\"/></g></svg>"
Examples
Example 1
import flag from "@johnmorrisdotca/hata/flags/suhh";
const host=document.createElement("div");
host.innerHTML = flag; // or toDataUri(flag) from "@johnmorrisdotca/hata" for an <img src>
console.log(host.querySelector("svg")?.getAttribute("viewBox"));Example 2
import { svg } from "@johnmorrisdotca/hata/flags/suhh";
console.log(svg.startsWith("<svg"),svg.length);true 1190What it prints (run when this page was built)