1

I am new to manage package development. I want to develop a Visual force page with Lightning styles. I know the two approaches as below:

  1. Using <apex:slds> tag. (I will have to change the version if the VF page to 39 or above)

  2. Uploading the Lightning Design System zip as a Static Resource

I am a bit concern about the changing version for manage package component. Also, does referring <apex:slds> tag would create any ambiguity in long run in case any style class changes? As referring static resource I can rely on the resource CSS I uploaded. Apart from this, I am missing on any perspective or alternative doing the same?

Any suggestions will be helpful! Thanks!

2
  • AFAIK you don't need any of them, slds is generally available, OOTB, just use slds classes in your markup, and should be working fiine
    – patryk
    Dec 18, 2018 at 7:41
  • @patryk Seems not to be.! Dec 18, 2018 at 10:09

1 Answer 1

1

Using the static resource method is not recommended:

Or (not recommended…): create a CSS file with a custom scoped outer wrapper

You should use apex:slds in all cases.

If you choose not to do so, as SLDS evolves, your page's design will not, and so it will not "look" like the rest of Salesforce. And, as they improve the SLDS and the VF specific classes, you won't get the benefits of those updates.

4
  • Yes, I do understand the same. However, as this is managed package product and my concern looking at the Release Notes: archive-2_0_3.lightningdesignsystem.com/release-notes is if there is any possibility that salesforce changing the class names or deprecating the CSS definition. One of a colleague has faced issues using slds tag as sometime back the CSS classes were changed in SLDS definition. Dec 18, 2018 at 9:51
  • @MadhaviBhattad Yes, sometimes classes change. They're in the release notes when they do. At this point, they should be fairly stable, though. Being an ISV means staying atop current technology. Do not use static resources, they will only age your pages faster than using the standard, current library.
    – sfdcfox
    Dec 18, 2018 at 9:55
  • So the recommended solution is to use the slds tag and keep your eye on the release notes in case of any affecting changes. Modify your pages accordingly and release a new version to be up to date. Dec 18, 2018 at 9:59
  • @MadhaviBhattad Yes. styles remain deprecated for at least one release, so you'll have upwards of six months to fix any problems. At this point, any changes should be rare anyways.
    – sfdcfox
    Dec 18, 2018 at 10:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .