function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mohita KalraMohita Kalra 

How to change Icon colour on the button.

Hi All...I am creating a button , where I have to put brand as variant and also need to get lead icon on it...I tried something like this but the icon doesnt appear because of the brand...is there anyway I can change icon colour to white on this button.
<lightning:button onclick="{!c.createLead}"
                                      variant="brand"
                                      abel="New Lead"
                                      iconName="standard:lead"
                                      disabled = "false"/> 
User-added image
       
If I use variant as Brand_outline , I can see the lead icon...But I cant use Brand_Outine and have to use brand only...so i thought of getting the colour changed to white for this icon...so that it becomes visible.

<lightning:button onclick="{!c.createLead}"
                                      variant="brand-outline"
                                      abel="New Lead"
                                      iconName="standard:lead"
                                      disabled = "false"/> 

User-added image
David Zhu 🔥David Zhu 🔥
when you talking about icon color? do you mean the text color or background color? what color you expect for both of them?
Barthelemy Laurans 1Barthelemy Laurans 1
Hi,

This is strange. According to documentation (https://developer.salesforce.com/docs/component-library/bundle/lightning:button/example#lightningcomponentdemo:exampleRegularButtonsIcon), the color is changed automatically.

Maybe there is something wrong in your brand css declaration ?

Best regards,
Barthélemy