You need to sign in to do that
Don't have an account?
David Cohen 15
Unable to stretch <lightning-button> tag to fill container
I'm unable to stretch a <lightning-button> to occupy the full width of its container. While applying a style of display: block or a class of slds-size_12-of-12, for example, those styles/classes are applied to the lightning-button tag... however... when rendered, the tag appears to wrap an inner <button> tag, and the styles are not transferred to that tag, and it's that inner tag that appears to have all the content.
<lightning-layout> <lightning-layout-item flexibility="grow"> <lightning-button label="click me" onclick={action} class="slds-size_12-of-12"> </lightning-button> </lightning-layout-item> <lightning-layout-item flexibility="no-flex"> ...
Alain Cabon
Hi,
David Cohen 15
Alain, if you look closer at my code, you'll see that I'm using new Lightning Web Components, and not the old Aura framework. <lightning-button>, not <lightning:button>. The stretch class, among others, does not appear to work with the LWC button. But thanks.