Salesforce Certified Application Architect

Friday 6 October 2017

How can i use lightning design system CSS(style) on my Lightning component?

Download (SLDS) platform-agnostic CSS framework.
  • Go to below link for download latest version of salesforce lightning design system framework.
  • https://www.lightningdesignsystem.com/downloads/
  • By the ltng:require tag in lightning component we can load external CSS and JavaScript libraries after we upload them as static resources.
<aura:component>
       <ltng:require styles="{!$Resource.SLDS24 + '/assets/styles/lightning-design-system-ltng.css'}"/>
<!--Button with lightning style sheet class-->
<button class="slds-button slds-button--neutral">Button Neutral</button>
</aura:component>


Note : Instead of upload  zip in static resource you can also use extends=”force:slds” in aura application.
Sample:
<aura:application extends=”force:slds” >
</aura>

No comments:

Post a Comment

Salesforce Certified Application Architect & Certified Data Architecture and Management Designer Exam

How to pass Salesforce Certified Data Architecture and Management Designer Exam This exam was 1st architect exam for me. Its not that muc...