Activity Forums Salesforce® Discussions Using SLDS styles in salesforce aura component

  • Kumar

    Member
    January 3, 2017 at 2:17 pm

    Hi everyone,

    How can I use SLDS styles in my components? I have added the SLDS as a static resource.

    Thanks

  • Satyakam

    Member
    January 4, 2017 at 12:54 pm

    Hi Kumar,

    If you have added your static resource named as 'SLDS' than you can use this in your component like:

    <ltng:require styles="{!$Resource.SLDS +'/assets/styles/salesforce-lightning-design-system.css'}"/>

    Thanks

  • Kumar

    Member
    January 4, 2017 at 1:27 pm

    Thanks!

  • Rajendra Rathore

    Member
    July 19, 2017 at 4:30 pm

    You can use extends="force:slds" in lightning application. So it will automatically apply slds to lightning components that are related to application.

     

    Example:

    <aura:application extends="force:slds">
    <!--component reference>
    </aura:application>

Viewing 1 - 4 of 4 posts

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos