Winter 18 – Automatic Styling of Visualforce Pages in Lightning Experience

How to use lightningStylesheets attribute to render Visualforce in Lightning Experience Stylesheet

Salesforce Winter 18 Logo

Reason I posted previous blog was to showcase life of Visualforce developer before and after Winter 18If we want to use same Visualforce in classic and Lightning experience then we had to check theme of logged-in user in Visualforce and render page section accordingly.

However, not any more. With Winter 18we have LightningStylesheet attribute available for apex:page tag. Below source code produces same output as of previous code, however no extra logic to detect and render page section as per logged in user theme.

Winter 18 - Automatic Styling of Visualforce Pages in Lightning Experience
Winter 18 – Automatic Styling of Visualforce Pages in Lightning Experience

Note :

  • This feature is still in Beta and Salesforce team is doing their best to produce most efficient code to render existing Visualforce into Lightning experience.
  • This would be applicable only for apex: tags in Visualforce. Custom stylesheet or hacks around standard stylesheet may not work.
  • Salesforce is also working on Google chrome extension which will show existing visualforce that how existing Visualforce page will look after using this tag. However there is no confirmed URL of this extension yet and could be available in next release.

Related posts