首页 > 解决方案 > SVG 应该使用自己的颜色,不管 css 填充:currentColor

问题描述

我的问题是这样的:

.icon {
  color: red;

  > svg {
    fill: currentColor;

    path,
    use {
      fill: currentColor;
    }
  }
}

现在我需要再次用 css/sass 覆盖上面的代码,并告诉 svg 它应该使用他自己的填充值:

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" **fill="#e1306c"**>

我无法解决这个问题 - 请帮忙!

标签: csssvgsass

解决方案


推荐阅读