Skip to main content
Lightning Experience Themes allow you to customize the look and feel of your Salesforce application, including colors, branding, and styling.

What are Lightning Experience Themes?

A Lightning Experience Theme is metadata that defines:
  • Brand colors and styling
  • Logo and images
  • Default branding set
  • Loading screen customization
Themes are defined using .lightningExperienceTheme-meta.xml files.

Theme File Structure

Themes are stored in the lightningExperienceThemes directory:

Basic Theme Example

Example: Recipes Blue Theme
Example: Recipes Lite Theme

Theme Configuration

defaultBrandingSet

References a branding set that defines colors, logos, and other visual elements:
The branding set is configured separately in Setup and includes:
  • Brand color
  • Logo
  • Page background color
  • Page background image

masterLabel

The display name for your theme:
This name appears in the Theme picker in Setup.

shouldOverrideLoadingImage

Controls whether to use a custom loading spinner:
Set to true to use a custom loading image defined in your branding set.

Component-Level Theming

While Lightning Experience Themes control the overall application appearance, you can make your components theme-aware using CSS custom properties.

Using SLDS Design Tokens

SLDS design tokens automatically adapt to the active theme:

Creating Theme Variables

Define component-specific theme variables:
By defining theme colors as CSS custom properties at the :host level, you can easily swap themes by changing just a few variables.

Creating Theme Variants

You can create multiple theme files for different use cases:
Each theme can reference a different branding set with unique colors and logos.

Deploying Themes

Deploy themes using Salesforce CLI:
Or include them in your package.xml:

Activating a Theme

  1. Navigate to Setup → Themes and Branding
  2. Click on the theme you want to activate
  3. Click “Activate”
Only one theme can be active at a time in an org. Users will see the active theme when they log in.

Best Practices

Design System Alignment

  • Use SLDS design tokens in components to respect theme colors
  • Follow SLDS guidelines for consistent user experience
  • Test components with different themes activated

Theme Organization

  • Create meaningful theme names that reflect their purpose
  • Document theme colors and branding elements
  • Keep branding sets organized and well-named
  • Use consistent naming conventions

Component Theming

  • Make components theme-aware using CSS custom properties
  • Avoid hard-coded colors - use design tokens instead
  • Define component-specific theme variables at :host level
  • Provide fallback values for better compatibility

Testing

  • Test your application with all available themes
  • Verify contrast ratios for accessibility
  • Check component appearance in different contexts
  • Validate branding elements display correctly

Advanced Theming Patterns

Gradient Backgrounds

Custom Border Radius

State-Based Theming

Use styling hooks to create state-based theme variations (hover, focus, active) that provide visual feedback while maintaining brand consistency.

Resources