You need to sign in to do that
Don't have an account?
Karthik j
How to give a colour to the utility icon used in lightning card
Hi All
I have used one utility icon for the icon-name attribute of lightning-card.
<lightning-card title="Account GMV" icon-name="utility:table"></lightning-card>
By default the utility icon will be displayed with no colour. Now I want to give a colour to it.
I tried add a CSS class inside the tag and write css code to give colur. That didn't work.
<lightning-card title="Account GMV" class ="greenClour" icon-name="utility:table"></lightning-card>
.THIS.greenClour svg{
fill: #7FFF00;
}
It didn't work. Can anyone please help me to achieve this?
I have used one utility icon for the icon-name attribute of lightning-card.
<lightning-card title="Account GMV" icon-name="utility:table"></lightning-card>
By default the utility icon will be displayed with no colour. Now I want to give a colour to it.
I tried add a CSS class inside the tag and write css code to give colur. That didn't work.
<lightning-card title="Account GMV" class ="greenClour" icon-name="utility:table"></lightning-card>
.THIS.greenClour svg{
fill: #7FFF00;
}
It didn't work. Can anyone please help me to achieve this?
Refer the below link will help you to proceed further.
https://developer.salesforce.com/docs/component-library/bundle/lightning-icon/documentation
https://salesforce.stackexchange.com/questions/147153/lightning-icon-color-is-not-changing-using-the-fill-css
Thanks!!
Try Below Css It Will Work For Every Icon And Will Change Colour Please Mark It As Best Answer If It Helps
Thank You!