Style your existing Visualforce page with Lightning Experience

Author - Kiranpreet

Style your existing Visualforce page with Lightning Experience

You can view your existing Visualforce page with lightning experience by simply adding a lightningStylesheets=”True” attribute in the tag.

This tag will work with Salesforce for Android, Salesforce for iOS, or Salesforce mobile web.

Example:-

Existing VisualForce page (Without lightningStylesheets Tag)

<apex:page standardController="Contact">
    	<apex:form >    
		<apex:pageBlock title="Edit Contact ">
			<apex:pageBlockSection >
				<apex:inputField value="{! Contact.FirstName}"/> 
				<apex:inputField value="{! Contact.LastName}"/>  
				<apex:inputField value="{! Contact.Email}"/>         
			</apex:pageBlockSection>
			<apex:pageBlockButtons >
				<apex:commandButton action="{! save }" value="Save" />        
			</apex:pageBlockButtons>
		</apex:pageBlock>
   	 </apex:form>
</apex:page>

Visualforce Lightning Experience

With lightningStylesheets Tag:

<apex:page standardController="Contact" lightningStylesheets="true" >
    <apex:form >
    
    <apex:pageBlock title="Edit Contact ">
        <apex:pageBlockSection >
            <apex:inputField value="{! Contact.FirstName}"/> 
             <apex:inputField value="{! Contact.LastName}"/>  
              <apex:inputField value="{! Contact.Email}"/>         
        </apex:pageBlockSection>
        <apex:pageBlockButtons >
            <apex:commandButton action="{! save }" value="Save" />        
        </apex:pageBlockButtons>
    </apex:pageBlock>    
   </apex:form>
</apex:page>

Visualforce Lightning Experience

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published. Required fields are marked *