TransWikia.com

Set Padding on Minimum Width [Aura]

Salesforce Asked by Al K on October 4, 2021

I’d like to add SLDS padding for a minimum width value of an input field. Have the padding set in my code, I just need it to only display when the width of the screen is larger than 760px

.cmp

    <div class="minimumWidth">
      <lightning:input class=" slds-size_1-of-1 slds-medium-size--1-of-2 slds-large-size--1-of-2 "
       name="field1" label="field1" required="true" aura:id="field1" />
   </div>

.css

.THIS .minimumWidth .slds-p-left_medium{min-width:760px;}

One Answer

In your markup, You can use slds classes. For padding you need to add slds-p-around_x-small class in your div tag.

<div class="minimumWidth slds-p-around_x-small">
      <lightning:input class=" slds-size_1-of-1 slds-medium-size--1-of-2 slds-large-size--1-of-2 "
       name="field1" label="field1" required="true" aura:id="field1" />
   </div>

Refer https://www.lightningdesignsystem.com/utilities/padding/ for slds classes for padding.

Answered by Aakriti.G on October 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP