Propagate class for generated SVG-images

This commit is contained in:
Pieter Vander Vennet 2023-11-16 03:30:29 +01:00
parent 34f0fa639c
commit 7469a0d607
114 changed files with 118 additions and 112 deletions

View file

@ -52,7 +52,13 @@ function genImages(dryrun = false) {
const nameUC = name.toUpperCase().at(0) + name.substring(1)
const svelteCode =
'<script>\nexport let color = "#000000"\n</script>\n' +
svg.replace(/\\"/g, '"').replace(/(rgb\(0%,0%,0%\)|#000000|#000)/g, "{color}")
svg
.replace(
"<svg ",
"<svg {...$$$$restProps} on:click on:mouseover on:mouseenter on:mouseleave on:keydown "
)
.replace(/\\"/g, '"')
.replace(/(rgb\(0%,0%,0%\)|#000000|#000)/g, "{color}")
fs.writeFileSync("./src/assets/svg/" + nameUC + ".svelte", svelteCode, "utf8")
}
module += `public static All = {${allNames.join(",")}};`