[SalesForce] Style Visualforce page to match Service Console

I have a visualforce page embedded in the Case layout and the buttons and text boxes don't match the styling in service console. I used view source to view the css file in the service console and I thought about referencing them in my page but the css files have this at the top:

  • This code is for Internal Salesforce use only, and subject to change without notice.
  • Customers shouldn't reference this file in any web pages.

Does anyone have an easier way to style visualforce pages to match the service console?

Serial Search button doesn't match

Best Answer

You need to use Salesforce Lightning Design System stylesheet which closely matches with Salesforce Console.

Approach 1: Include the css in static resource and start using it

<apex:stylesheet value="/resource/slds/assets/styles/salesforce-lightning-design-system-ltng.css"/>

Approach 2: Using apex:slds

Allows Visualforce pages to reference Lightning Design System styling. Use this component instead of uploading the Lightning Design System as a static resource.

Include in a Visualforce page to use Lightning Design System stylesheets in the page.

In general, the Lightning Design System is already scoped. If you set applyBodyTag or applyHtmlTag to false, however, you must include the scoping class slds-scope. Within the scoping class, your markup can reference Lightning Design System styles and assets.

Related Topic