From fc3924df49de36ea1da2c2adb42fd5aeb6d3e545 Mon Sep 17 00:00:00 2001 From: Theophile Sandoz Date: Wed, 10 Jul 2024 15:38:36 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20support(lld):=20Fix=20generated?= =?UTF-8?q?=20icons=20attributes=20case=20(#7264)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix generated icons attributes case * Add changeset --- .changeset/tame-donuts-float.md | 5 +++++ libs/ui/packages/icons/scripts/build.js | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/tame-donuts-float.md diff --git a/.changeset/tame-donuts-float.md b/.changeset/tame-donuts-float.md new file mode 100644 index 000000000000..74927aa4724e --- /dev/null +++ b/.changeset/tame-donuts-float.md @@ -0,0 +1,5 @@ +--- +"@ledgerhq/icons-ui": patch +--- + +Fix generated icons attributes case diff --git a/libs/ui/packages/icons/scripts/build.js b/libs/ui/packages/icons/scripts/build.js index c8a2cff8d909..03967dca2803 100644 --- a/libs/ui/packages/icons/scripts/build.js +++ b/libs/ui/packages/icons/scripts/build.js @@ -184,12 +184,12 @@ const convert = (svg, options, componentName, outputFile) => { component = component.replace(/fill="white"/g, 'fill="currentColor"'); component = component.replace(/stroke="white"/g, 'stroke="currentColor"'); - component = component.replace(/]*)?\s*>)/gi, "$1Svg$2"); - component = component.replace(/strokeWidth={(\d+(\.\d+)?)}/g, "stroke-width={strokeWidth}"); + component = component.replace(/strokeWidth={(\d+(\.\d+)?)}/g, "strokeWidth={strokeWidth}"); } component = component.replace(/strokeWidth={(\d+(\.\d+)?)}/g, "strokeWidth={strokeWidth}"); fs.writeFileSync(outputFile, component, "utf-8");