You need to sign in to do that
Don't have an account?
Icon color is not changing using the fill CSS
According to the documention (https://www.lightningdesignsystem.com/components/icons/ ) we can chnage the icon color by suing the CSS. I am not able to do it. It always overides with the Salesforce style.
Other css property like baground color are applying but fill is always getting overirdder by salesfroce defult color ( grey). Any one have any idea on how to fix this ?
<lightning:icon class="icn" iconName="utility:favorite" size="small" />
.THIS .icn{ fill: white; }
Other css property like baground color are applying but fill is always getting overirdder by salesfroce defult color ( grey). Any one have any idea on how to fix this ?
All Answers
Can you please try like below. A space might be needed if its the child of an element.
. THIS .icn{ fill: white; }
Please mark this as the best answer, if it serves the purpose.
Thanks,
Rohit Alladi
<lightning:icon class="icn" iconName="doctype:pdf" size="small" />
.THIS.icn svg {
fill:orange !important;
}
.THIS.icn{
background-color:blue !important;
}