I would like to read the Custom Theme/Branding Settings opened up in Spring 18 release.

The objective is to be able to read or access the background color and background image used in the theme/branding, so that I can use the same effect in a VF page, which is not a lightning component.

This is necessary because, the iframes created for Visualforce pages has forced White background, so the theme branding background could not be seen with us re-creating the theme in VF page css.

Any way to do that? (Not looking to create a Lightning Component for the VF page replacement)


Two possibilities I can find:

  1. <apex:slds/> should automatically bring in theming to Lightning style classes. I don't know however if it includes the background colour or not. https://releasenotes.docs.salesforce.com/en-us/spring18/release-notes/rn_vf_apex_slds_theme.htm

  2. You could make a callout to the UI API to get info about the active theme. https://releasenotes.docs.salesforce.com/en-us/spring18/release-notes/rn_vf_apex_slds_theme.htm


This could be done from Apex or Visualforce but it's just not as straightforward as querying.

  • I ll look into option 2. The other option 1 does not render background colors. The idea is to be able to use same canvas bordering like lightning component do when they r placed on a lightning page. – VarunC Feb 5 '18 at 16:31

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.