defaultconstant
The flag of Hong Kong SAR China (中華人民共和国香港特別行政区), HK, as an SVG string: viewBox 900 by 600 (3:2), 570 B. From Wikimedia Commons, "Flag of Hong Kong.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 value from "@johnmorrisdotca/hata/flags/hk";
Definition
const svg: string = "<svg data-hata=\"hk\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"#ee1c25\" viewBox=\"0 0 900 600\"><path d=\"M0 0h900v600H0z\"/><g id=\"hata-hk-a\"><path fill=\"#fff\" d=\"M493 125.2a28 28 0 0 0-15 41.8 45.2 45.2 0 0 1-20.3 66.2 38.7 38.7 0 0 0-10.8 64.3 68.4 68.4 0 0 1-17-94l-1.1-1a70 70 0 0 0 16.7 95.8A90.3 90.3 0 0 1 493 125.2\"/><path d=\"m452 181.1-27.6 12 29.4 6.5-20-22.5 3 30\"/></g><g id=\"hata-hk-b\"><use href=\"#hata-hk-a\" transform=\"rotate(72 450 300)\"/><use href=\"#hata-hk-a\" transform=\"rotate(216 450 300)\"/></g><use href=\"#hata-hk-b\" transform=\"rotate(72 450 300)\"/></svg>"
Examples
Example 1
import flag from "@johnmorrisdotca/hata/flags/hk";
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/hk";
console.log(svg.startsWith("<svg"),svg.length);true 570What it prints (run when this page was built)