[SalesForce] SLDS css stylesheet not found

I'm doing Salesforce trailhead, Lightning Component Basics – Input Data Using Forms. I have a problem with SLDS static resource. Earlier, I had downloaded slds 2.0.2 (named it SLDS202). Inside lightning application I have the following line of code:

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

However, when I run the page, I can see in the console error 404 not found. I also tried this one:

<ltng:require styles="/resources/slds202" />

but in console another error appears: Refused to load the stylesheet (…) because it violates the following Content Security Policy directive: "style-src 'self' chrome-extension: 'unsafe-inline'".

Could you tell what the problem is about?

Best Answer

They changed the file name in 2.0 it seems. If you look in the zip file you downloaded you will see that the stylesheet is now named:

salesforce-lightning-design-system.css

So the following should work for you:

<ltng:require styles="/resource/SLDS202/assets/styles/salesforce-lightning-design-system.css" />
Related Topic