0

Salesforce has suggested we add the version number of slds into the static resource .zip file name. So when we use it in our page, it would be something like:

<apex:stylesheet value="{!URLFOR($Resource.SLDS213, 'assets/styles/salesforce-lightning-design-system-vf.css')}" />

I think Salesforce claims the slds code today will still be working under tomorrow's version only with the latest design. So it shouldn't be an issue if we upload a newer version and simply replace the old one. And when we need to keep the version number of slds, if we need to keep up with latest design, for every release, we will need to update all of our VF pages. So why do we want to do that.

  • Doesn't it revolve around caching? By having the version number in the name, if the resource is updated, there isn't a cached version that is being retrieved. – Nick Cook Nov 7 '16 at 4:43
  • @NickCook Using URLFOR would avoid the caching issue, actually, as it formats the resource to /resource/<timestamp>/resourcename/... – sfdcfox Nov 7 '16 at 4:58
  • 2
    Additions and depreciation happens frequently in the current version s of SLDS. At a minimum I would put the version in the description. Not sure if the overhead of putting it in the filename is worth it and would depend on how impactful the changes are from the version you are using to the newer version. – Eric Nov 7 '16 at 5:24
2

A better alternative for this is to use extends="force:slds" in our lightning applications. Firstly it will include the latest version of library and it would take away the hassles of developers updating the versions now and then.

Reference document : Extends force:slds

  • Communities templates & lightning experience have inbuild slds support.

And if we incorporate extends force:slds in our lightning applications we can keep up to date and be consistent with Lightning Design System enhancements.

Update :

Though these versions number will be of use when we use lightning design system in VF pages without lightning components. Hope Salesforce comes up with some tag similar to <apex:includeLightning /> to ease this use of being consistent with the lightning design library static resources in VF pages.

  • 1
    extends="force:slds" seems only works for lightning app, not VF pages IMO? – Lance Shi Nov 7 '16 at 4:51
  • Right ! I guess we will have to wait until we have a similar tag like <apex:includeLightning /> in the upcoming releases. – StormBr34ker Nov 7 '16 at 4:52

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.