5

I've a question on implementing SLDS in lightning apps and commponents. I was going through a tutorial where I saw the instructor is installing slds unmanaged package and then referring the static resource using ltng:require on the app like

  <aura:application>
     <ltng:require styles="/resource/slds100/......."
  </aura:application>

On trailhead I don't see anything like that and all they say is to use extends="force:slds" on the app as below -

<aura:application extends="force:slds">
   <c:AccountCmpTest />
</aura:application>

I'm currently using this and it's working, so is this the correct approach or we still have to associate the ltng:require tag?

15

force:slds was recently introduced in winter'16; with which we can skip the additional step of having a static resource:

Your application automatically gets Lightning Design System styles and design tokens if it extends force:slds. This method is the easiest way to stay up to date and consistent with Lightning Design System enhancements.

The mentioned tutorial would be based on older version, at that moment this feature was not available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.