I have uploaded the Salesforce Sans font as satic resource in my dev org.

enter image description here

How to use this sytle in my lightning component.

<lightning:layout multipleRows="true">
    <lightning:layoutItem size="12" mediumDeviceSize="5" class="border">
        <div class="slds-box" style="font-family:sans-serif;">
            My first Lightning componet

Please help me out !!


Add a custom css class instead of your inline style (eg. customFont).

<p class="customFont"> TEST </p>

In your css file add the following:

customFont.THIS {
    font-family: 'customSalesforceFont';
    font-size: 1.2rem;
@font-face {
   font-family: 'customSalesforceFont';
   src: url(/resource/SalesforceSans-Book); 
| improve this answer | |

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.