Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
 fix cannot change svg color  by  parent node problem
  • Loading branch information
leaderli authored Dec 3, 2021
1 parent ea0615c commit ed3a4b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ export async function compilerIcon(
const { data } = await optimize(content, svgOptions);
content = data;
}

// fix cannot change svg color by parent node problem
content = content.replace(/stroke="[a-zA-Z#0-9]*"/,'stroke="currentColor"')
const svgSymbol = await new SVGCompiler().addSymbol({
id: symbolId,
content,
Expand Down

0 comments on commit ed3a4b1

Please sign in to comment.