I am following this Salesforce article to modify the "brand" button variant with a custom color, but it will not use my css styling changes. The goal is to use it in Screen Flow, and also pass a variable input from the flow (button label).
Here is my code so far:
Aura Component
<aura:component implements="lightning:availableForFlowScreens" access="global">
<aura:attribute name="nextButtonLabel" type="String" default="Next"/>
<lightning:button class="button" variant="brand" label="{!v.nextButtonLabel}" name="ButtonNext" onclick="{!c.handleClick}" />
</aura:component>
Controller
({
handleClick : function(component, event, helper) {
var buttonName = event.getSource().get("v.name");
var action ="";
if (buttonName == 'ButtonNext')
action="NEXT";
var navigate = component.get('v.navigateFlow');
navigate(action);
}
})
Style
.THIS :host {
--slds-c-button-brand-color-background: orange;
--slds-c-button-brand-color-border: orange;
}
Design
<design:component >
<design:attribute name="nextButtonLabel" label="Next Button Label"/>
</design:component>
Here, you can see I've added the Aura Component to a screen flow.
But when running the flow, the color does not change, and it stays on the default brand color.
Any help is greatly appreciated!