Activity Forums Salesforce® Discussions How to use External CSS in lightning components?

  • Piyush

    Member
    October 11, 2019 at 2:30 am

    Hi Nikita,

    If you need to use your style sheet to multiple lightning components or lighting applications, then it’s always recommended to define a common style sheet in a separate file with extension as .css. Upload this external CSS file as a static resource and it will be included in the Lightning component using

    <ltng:require styles=”{! $Resource.staticResourceFileName}”/>  tag.

  • Saddam

    Member
    October 11, 2019 at 6:55 am

    Hi,

    you can use this tag

    <ltng:require styles=”{! $Resource.staticResourceFileName}”/>

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos