【发布时间】:2018-03-17 19:37:17
【问题描述】:
我正在使用 userstyles.org,自定义 CSS(我是个 hack)以获得想要的效果。
我想用一种颜色填充所有 SVG,但排除一些 SVG 不受填充的影响。
假设我有一个名为 image 的 data-icon,我该如何排除它或重置它的属性?
我有以下内容:抱歉,此示例中没有 HTML。
/* set colour vars */
:root {
--bgi: #B4B4B4; /* icon colour */
--bgf: #B4B4B4; /* icon fix */
}
/* colour icons */
span svg path {
fill: var(--bgi);
}
/* fix misc icons */
span[data-icon="link"] svg path
{
fill: var(--bgf) !important;
}
/* exclude icons */
span[data-icon="image"] svg path
{
fill: none !important;
}
"fill: none" 只是使 SVG 透明。
帮助?
【问题讨论】: