* feat: layout docs integration * fix: preview a site not just after deployment * @w-21612472 Test Skills for branding sets * Remove mandatory tip * feat: update wording for loading ref docs * feat: add brief description on what object pages are * feat: add instrux to ensure steps are followed correctly * feat: use stricter wording for initial instruction * fix: rm useless instruction * fix: theme layout fixes * feat: more explicit wording * feat: add instrux to better handle global skills * fix: bring back steps wording just in case * fix: rm old refs --------- Co-authored-by: KarthikSalesforce <131800461+KarthikSalesforce@users.noreply.github.com> Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
5.9 KiB
Content Type: sfdc_cms__brandingSet
Use when user explicitly requests creating/updating branding set.
Table of Contents
- Core Principles
- Generation Guidelines
- Editing Existing Branding Sets
- Branding Property Patterns
Core Principles
- Purpose: Manage site-wide branding properties (colors, fonts, etc.).
- Site Association: Branding sets are linked to the site configuration.
Generation Guidelines
1. Directory Structure
- Location:
digitalExperiences/site/[SITE_NAME]/sfdc_cms__brandingSet/[BRANDING_SET_NAME]/ - Required Files:
_meta.json- Metadata file defining the API name and typecontent.json- Content file defining the configuration and layout
- Naming Convention: Underscore-separated names (e.g.,
Branding_Set).
2. _meta.json Structure
The _meta.json file must contain:
{
"apiName": "[BRANDING_SET_NAME]",
"type": "sfdc_cms__brandingSet",
"path": "brandingSets"
}
Rules:
apiName: Must match the directory name exactly (e.g.,Branding_Set)
3. content.json Structure
The content.json file must contain:
{
"type": "sfdc_cms__brandingSet",
"title": "[DISPLAY_TITLE]",
"contentBody": {},
"urlName": "[URL_NAME]"
}
Field Definitions:
type: Required. Represents the content type. The only supported value is"sfdc_cms__brandingSet".title: Required. Human-readable display title (e.g., Branding Set).- Maximum length is 100 characters.
- Must be unique within the space's brandingSet content items.
contentBody: Include allrequiredproperties fromschemaDefinition.- Seed: Always call
execute_metadata_actionwithshouldIncludeExamples: true. Copy the entire example object fromexamplesOfContentType[0]intocontent.json. NEVER start from a minimal stub. - Recalculate (CRITICAL STOP): You MUST stop and perform explicit changes for dependent tokens BEFORE generating JSON.
-
[] Refer to "Branding Property Patterns" for detailed calculations.
-
brandingSetType: Represents whether the color palette is for the entire site or a specific section.APP: The branding set applies to the entire site. There can be only one branding set of this type.SCOPED: ASCOPEDbranding set can be applied only to a section component for granular overrides.
-
definitionName: Required. Represents the name for the branding set used in the site or template’s theme.- Build Your Own (LWR): uses
talon-template-byo:branding - Microsite: uses
microsite-template-marketing:branding
- Build Your Own (LWR): uses
-
values: Required. Represents a map (object) of branding values (colors, fonts, etc.) that can be applied to a site.- Format: An object containing key-value pairs that represent branding-set values.
- Patterns: See the "Branding Property Patterns" section for details on value relationships.
- Seed: Always call
urlName: Lowercase with hyphens (e.g.,branding-set)
4. Naming Conventions Summary
| Field | Format | Example |
|---|---|---|
| Directory/apiName | Underscore-separated | Branding_Set |
| title | Human-readable | Branding Set |
| urlName | Lowercase-hyphens | build-your-own-lwr |
5. Generation Checklist
- Directory and
_meta.jsonfollow naming conventions content.jsonhas all required fieldscontentBodyfollows the schema provided byexecute_metadata_action- STOP AND VERIFY:
contentBody.valueshonors all Branding Property Patterns defined below and explicitly recalculated and updated all dependent tokens based on any token updates requested by the user.
Editing Existing Branding Sets
Use this section when modifying existing branding sets under the sfdc_cms__brandingSet directory.
Editing Checklist
- Ensure all modified branding properties honor the Branding Property Patterns defined below.
Branding Property Patterns
When generating or validating contentBody.values, follow these established patterns for consistency:
1. Color Scaling Patterns (The "Rule of 3")
Salesforce uses a numeric suffix system (Color, Color1, Color2, Color3) to create a tonal palette.
- Darkening Trend: As the suffix number increases, the color becomes progressively darker.
- Example:
BackgroundColor(#ffffff) →_BackgroundColor1(#ebebeb) →_BackgroundColor2(#c2c2c2) →_BackgroundColor3(#858585).
- Example:
- Contrast/Foreground Colors: Every base color has a corresponding
ForegroundColorto ensure accessibility.- WCAG Compliance: Ensure a color contrast ratio of at least 4.5:1 between the background and foreground colors for standard text.
- Dark base colors usually have white (#ffffff) foregrounds.
- Light base colors (like
_NeutralColor) usually have black (#000000) foregrounds.
2. Font Size Hierarchy
- Base vs. Small: The
Smallvariant is typically 75% of the base size.- Example:
BodyFontSize(1rem) →BodySmallFontSize(0.75rem).
- Example:
- Heading Scale: Headings follow a standard typographic scale:
HeadingExtraLarge: 2.5remHeadingLarge: 1.75rem (~70% of XL)HeadingMedium: 1.25rem (~50% of XL)HeadingSmall: 1.125rem
3. Design Token Mapping
Prefer using DXP Design Tokens over hardcoded values where possible:
- Fonts: Use
var(--dxp-s-html-font-family)for base, body, and button fonts. - Brand Alignment: Use
var(--dxp-g-brand)for primary brand colors and links.
4. Component Consistency
- Buttons: Maintain consistent
BorderRadius(e.g., 4px) across all button sizes (Small, Medium, Large). - Form Elements:
FormElementLabelFontSizeandFormElementTextFontSizeshould match.
5. Spacing and Ratios
- Device Ratios: Desktop spacing (padding/spacers) is typically 1.33x larger than mobile spacing.
- Example:
ColumnSpacerSizeDesktop(1rem) vsColumnSpacerSizeMobile(0.75rem).
- Example: