0

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;}

1 Answer 1

0

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.

2
  • Thank you but I have the padding set in my code, I just need it to only display when the width of the screen is larger than 760px
    – Al K
    Commented Jul 21, 2020 at 13:14
  • 1
    You can use lightning layout & lightning layout items & set the different size for small, medium & large devices... developer.salesforce.com/docs/component-library/bundle/…
    – Aakriti.G
    Commented Jul 22, 2020 at 4:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .