Remove stroke current color
This commit is contained in:
@@ -87,6 +87,7 @@ final class IconRuntime implements RuntimeExtensionInterface
|
||||
$rawSvgMarkup = $this->getSvgMarkup($iconFilepath);
|
||||
$cleanSvgMarkup = $this->removeExistingTitleElement($rawSvgMarkup);
|
||||
$cleanSvgMarkup = $this->removeBlackStrokeAttributes($cleanSvgMarkup);
|
||||
$cleanSvgMarkup = $this->removeStrokeCurrentColor($cleanSvgMarkup);
|
||||
|
||||
return $this->removeBlackFillAttributes($cleanSvgMarkup);
|
||||
}
|
||||
@@ -119,6 +120,11 @@ final class IconRuntime implements RuntimeExtensionInterface
|
||||
return preg_replace('/stroke(=|:)"?\s*(#0{6}|#000|rgb\(\s*0,\s*0,\s*0\s*\)|black)\s*"?/', '', $content);
|
||||
}
|
||||
|
||||
private function removeStrokeCurrentColor(string $content): string
|
||||
{
|
||||
return \preg_replace('/stroke=(\'|")currentColor(\'|")/', '', $content);
|
||||
}
|
||||
|
||||
private function removeBlackFillAttributes(string $content): string
|
||||
{
|
||||
return preg_replace('/fill(=|:)"?\s*(#0{6}|#000|rgb\(\s*0,\s*0,\s*0\s*\)|black)\s*"?/', '', $content);
|
||||
|
||||
Reference in New Issue
Block a user