Skip to content

Commit

Permalink
🧹 support(lld): Fix generated icons attributes case (#7264)
Browse files Browse the repository at this point in the history
* Fix generated icons attributes case

* Add changeset
  • Loading branch information
thesan authored Jul 10, 2024
1 parent 70074f8 commit fc3924d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/tame-donuts-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/icons-ui": patch
---

Fix generated icons attributes case
6 changes: 3 additions & 3 deletions libs/ui/packages/icons/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(/<path/g, '<path vector-effect="non-scaling-stroke"');
component = component.replace(/<Path/g, '<Path vector-effect="non-scaling-stroke"');
component = component.replace(/<path/g, '<path vectorEffect="non-scaling-stroke"');
component = component.replace(/<Path/g, '<Path vectorEffect="non-scaling-stroke"');

if (!options.native) {
component = component.replace(/(<\s*\/?\s*)svg(\s*([^>]*)?\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");
Expand Down

0 comments on commit fc3924d

Please sign in to comment.