Using Styles from Salesforce Stylesheets

Salesforce uses different stylesheets (.css files) throughout the application to ensure that every tab conforms to the Salesforce look and feel. These stylesheets are automatically included on a Visualforce page unless you specify false for the showHeader attribute of the <apex:page> tag.
Warning

Warning

Salesforce stylesheets aren’t versioned, and the appearance and class names of components change without notice. Salesforce strongly recommends that you use Visualforce components that mimic the look-and-feel of Salesforce styles instead of directly referencing—and depending upon—Salesforce stylesheets.

When you disable the inclusion of the Salesforce stylesheets, only your custom stylesheets affect the styling of the page. For the purposes of building up styles that partially or fully match the Salesforce look and feel, you might want to look at and use selected contents from the default stylesheets.

The following stylesheets contain style classes you can reference. They are located in the /dCSS/ directory of your Salesforce instance.
  • dStandard.css – Contains the majority of style definitions for standard objects and tabs.
  • allCustom.css – Contains style definitions for custom tabs.
Important

Important

Salesforce doesn’t provide notice of changes to or documentation of the built-in styles. Use at your own risk.

Previous
Next