Skip to content

Commit

Permalink
Feat(icons): Do not remove colors from icons with -colored suffix #…
Browse files Browse the repository at this point in the history
…DS-990
  • Loading branch information
crishpeen committed Nov 9, 2023
1 parent eb16312 commit 680350f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/icons/scripts/buildSvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const normalizeAndCopySvg = (srcDir, distDir) => {
const svgPath = path.join(srcDir, svg);
const svgDistPath = path.join(distDir, svg);
const svgContent = fs.readFileSync(svgPath, 'utf8');
const svgContentFixed = svgContent.replace(/fill="#\w+"/g, 'fill="currentColor"');
const svgContentFixed = svg.endsWith('-colored.svg') ? svgContent : svgContent.replace(/fill="#\w+"/g, 'fill="currentColor"');
const svgSpriteContent = svgContentFixed
.replace(/<svg.*(viewBox="(\d+\s){3}\d+").*>/, `<symbol id="${svg.slice(0, -4)}" $1>`)
.replace(/<\/svg>/g, '</symbol>');
Expand Down

0 comments on commit 680350f

Please sign in to comment.