LightningExperienceTheme defines a custom Lightning Experience theme and links it to a separate BrandingSet containing its visual branding properties. Themes support configurable attributes such as three colors and five images. The colors and some images override Salesforce Lightning Design System (SLDS) tokens, which are named design values, and influence generation of app.css. This metadata changes the rendered interface, not just the theme's name in Setup.
The theme definition, its branding properties, and its activation setting are separate. Deploying a BrandingSet alone is not equivalent to migrating a theme, and deploying a theme definition is not the same as activating it.
Key Elements
| Element | What the Element Controls |
|---|---|
defaultBrandingSet |
Required reference to the separate BrandingSet containing the theme's branding properties. Match the actual component identity; the field's documented "ID" wording does not establish that a Salesforce record ID is required. |
masterLabel |
Required display label in Setup, limited to 70 characters. It is not the API name used to activate the theme. |
designSystemVersion |
Selects the SLDS foundation. Allowed values are SLDS_v1 and SLDS_v2. If omitted, the documented default is SLDS_v1. |
isDarkModeEnabled |
Allows individual users to enable dark mode when true; defaults to false. This beta capability is available for custom SLDS 2 themes in select editions. |
shouldOverrideLoadingImage |
When true, the theme overrides the splash screen image. |
Behavior and Constraints
The type is available when the S1DesktopAllowed permission is enabled in the org.
Custom theme activation belongs to LightningExperienceSettings, not to an element within LightningExperienceTheme. The documented Metadata API activation instruction is to set activeThemeField on the settings component to the theme's API name. Do not substitute masterLabel, which controls the label displayed in Setup. There is an unresolved naming discrepancy between that instruction and reported serialized settings, described below.
isDarkModeEnabled permits a user choice; it does not force all users into dark mode. Setting the boolean to true also does not establish feature availability by itself. The theme must be a custom SLDS 2 theme, and availability depends on edition.
Deployment and Retrieval
Metadata API components use the .lightningExperienceTheme suffix and reside in the lightningExperienceThemes folder. Source-format projects use files such as R2C2.lightningExperienceTheme-meta.xml. The type supports * as a member in package.xml, so a retrieval can select all theme definitions without knowing each theme's name. See the Metadata API definition.
When migrating both the theme and its branding configuration, include separate manifest entries for LightningExperienceTheme and BrandingSet. For an image-bearing theme, the migration can also involve ContentAsset components for the images. The required scope depends on the actual references and which components already exist in the destination.
A missing-branding error calls for checking the exact identities, not applying a prefix rule:
- Compare
defaultBrandingSetwith the actualBrandingSetcomponent name. - Check that the manifest member identifies that same component.
- Check that the referenced branding component is included in the deployment or already exists in the destination.
The prefix LEXTHEMING appears in examples and deployment reports, but those examples do not establish a general requirement to add or remove it. A report of success after removing the prefix also contained an original manifest name mismatch.
Treat activation as a separate configuration operation. A package that contains the theme definition and its branding dependencies does not, by that fact alone, express which theme should be active.
Relationships
The theme directly references its branding configuration. Image assets can be additional dependencies through that configuration; they are not exposed as direct image-reference elements on LightningExperienceTheme. The separate Lightning Experience settings component selects the active custom theme.
References
-
BrandingSet:defaultBrandingSet.
Referenced By
-
LightningExperienceSettings:activeThemeFieldin the documented activation instruction;activeThemeNamein reported serialized settings. The element-name discrepancy remains unresolved.
Documentation Inconsistencies
-
Activation element name: The custom-theme activation instruction names
activeThemeFieldonLightningExperienceSettings. A June 2024 deployment report instead showsactiveThemeNameinLightningExperience.settings-meta.xml. Neither is an element ofLightningExperienceTheme, and the report does not independently resolve the discrepancy. -
Branding reference identity: The description of
defaultBrandingSetcalls its value an ID, but the metadata example uses the name-like stringSummerCelebrationBrand. Reported deployment errors also resolve the reference as aBrandingSetname. Do not interpret the ID wording as proof that the field requires a Salesforce record ID.
Reported Issues
-
A BrandingSet-only deployment reportedly left the theme absent from the destination. In a 2018 migration discussion, adding
LightningExperienceThemewas the reported solution. The revised migration package also includedContentAssetcomponents for theme images. This supports checking the theme definition and its actual dependencies rather than assuming the branding component represents the whole theme. See the theme migration discussion. -
Missing-branding and missing-theme errors were reported together during deployment. In June 2024, the author reported success after removing
LEXTHEMINGfrom the branding component name and its references. However, the original manifest namedLEXTHEMINGTR2C2, while the file and theme reference usedLEXTHEMINGR2C2. The result does not establish a universal prefix-removal workaround. See the branding deployment report.
Common Questions
Why doesn't my Lightning theme appear after I deploy its BrandingSet?
BrandingSet contains the branding configuration, not the theme definition. A reported migration required adding LightningExperienceTheme. Image-bearing themes can also involve referenced ContentAsset components that are not already in the destination.
How do I activate a custom Lightning theme through Metadata API?
Activation is configured through LightningExperienceSettings using the theme's API name, not its masterLabel. The documented instruction names activeThemeField, while a deployment report shows activeThemeName. That naming discrepancy remains unresolved; neither field belongs in the theme definition.
Does defaultBrandingSet need a record ID or a LEXTHEMING prefix?
The documented ID wording does not prove that a record ID is required: the example uses a name-like value, and reported errors look for a BrandingSet by name. Match the actual component identity across the reference, file, and manifest. There is no established general rule to add or remove LEXTHEMING.
Does isDarkModeEnabled turn on dark mode for everyone?
No. It allows individual users to enable dark mode. It defaults to false, and the beta capability is limited to custom SLDS 2 themes in select editions.
Can I retrieve all LightningExperienceTheme components with a wildcard?
Yes. LightningExperienceTheme supports * as a manifest member. For a migration, also account for the referenced branding configuration and any required image assets.