0

Lightning Design Tokens are so helpful when specifying dynamic CSS variables, which helps to greatly reduce the design maintainability cost of Lightning applications.

Is there a similar concept but for Visualforce pages (Salesforce Classic)? I understand that one can use Lightning Out, create a Lightning component and display that in a Visualforce page hence, could use Lightning Design Tokens that way but I'd rather have an equivalent functionality but for Salesforce Classic.

Is there an equivalent of Lightning Design Tokens but for Classic or is the nearest thing possible to use a custom setting?

1

There's no analogy to Design Tokens in Visualforce. Instead, what you'd use is apex:stylesheet so that all pages could share the same style. Obviously, this meant that you'd have to design all your pages to be the same, and import potentially many unused styles just to maintain a consistent branding.

Lightning Design Tokens offer a new flexibility, allowing you to create a brand that you can share across components without having to have the same style sheet; each component can now import only the styles they need while still benefiting from a consistent branding.

And yes, you could use Custom Labels or Custom Settings, but in typical cases, Visualforce pages would use a shared Static Resource instead. Custom Labels should ideally be used for translatable text, not branding or styles. Of course, there's no restriction on doing so, and using Custom Labels or Custom Settings have a specific feature: you can provide a customizable experience for users based on their selected language or profile.

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.