HomeFrontend Development › The Style System

The Style System

Purpose: Deliver visual variants of components through policies and CSS classes instead of code forks.

Who this page is for

AudienceWhy it matters to you
Frontend engineersVariant mechanics
All engineersGovernance of visual variety

How it works

A component's template policy defines named styles, each mapping to CSS class(es). Authors pick styles in the editor (brush icon); AEM adds the classes to the component's decoration element. Your CSS does the rest.

Policy "PHI plan card":
  Style group "Appearance" (single-select):
    "Standard"  → (no class)
    "Featured"  → cmp-plancard--featured
    "Compact"   → cmp-plancard--compact
  Style group "Badges" (multi-select):
    "Gold trim" → cmp-plancard--gold

Why this beats alternatives

AlternativeProblem
Dialog dropdown "variant" fieldLogic leaks into HTL; authors can't preview; not policy-governed
Separate components per variantN components to maintain for CSS-only differences
Authors adding free-form classesUngoverned, breaks on refactor

Style System keeps variants CSS-only, named, governed per template — designers define the menu, authors choose, code stays single.

Engineering rules

Quick navigation