function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pablo GarciaPablo Garcia 

Visualforce pages for both Classic Salesforce and Salesforce1/Lightning Experience, which is the best approach?

Hi,

We have to develope some Visualforce pages. Initially, these pages will be shown in the Classic Salesforce mode and in the Salesforce1 app. But it is sure that these pages will be shown in the Lightning Experience.

Reading Salesforce documentation, for Salesforce1, we saw that some apex components like <apex:pageBlock>, <apex:pageBlockSection>, and so on, must replaced with <div>, <p>, <span> and so on. Furthermore, the attribute standardStylesheets of <apex:page> is set to false when showing the page in Salesforce1. So, we must set the styles "manually". We know that we can use <apex:variable> to get the UITheme and to select the suitable css file. This means that we need two style sheets with same class names, one for Classic and another for Lightning or Salesforce1.

Keeping in mind that some of these pages will be embedded in layouts, we want to visualize these pages with the Classic look and feel, when the user is this mode, and Salesforce1 and Lightning look and feel while the page is shown in the mobile app o the Lightning Experience. Shall we create a style sheet for each mode? Which is the better approach for this?

Thanks in advance!