CEM D4 Layering — Signed Depth, Planes, and Appearance Shifts

Status: Canonical
Last updated: 2026-09-27 Taxonomy placement: D4. Layering (treats depth + elevation as one consumer concept)

CEM uses layering as the umbrella term for:

Companion specs:

Contents

  1. What layering means to users
  2. Consumer layering vocabulary
  3. User-flow journey through layering
  4. Design goals
  5. Signed ladder and planes
  6. Token model
  7. Basis tokens and appearance-change principle
  8. Semantic endpoints contract
  9. Representation channels
  10. Scrim
  11. Action states and the color ladder
  12. Cross-dimension coupling
  13. Accessibility and forced-colors requirements
  14. Component mapping matrix
  15. Implementation guidance
  16. Canonical token summary
  17. Governance and versioning
  18. Migration notes
  19. References

1. What layering means to users

Layering communicates relationship and intent before interaction:

In consumer language, layering typically reads as:

Layering exists to support three outcomes:

  1. Orientation — know what is “infrastructure” vs “work.”
  2. Separability — see boundaries without reading.
  3. Commitment clarity — distinguish “context” from “decision.”

2. Consumer layering vocabulary

2.1 Common terms

2.2 Semantic tiers are not a z-index ladder

The tier number communicates priority and meaning (user psychology), not guaranteed draw order. Physical stacking may differ because of clipping, portals, and platform APIs. That physical mismatch does not change the semantic contract.

Normative rules

Discriminator rules: Overlay vs Floating

Use these rules when physical appearance could be misread (notably when overlays appear over dialogs).

Examples (required interpretation)

2.3 7-tier canonical ladder

CEM defines exactly 7 canonical tiers. The ladder is signed: two recess rungs, one base rung, and four lift rungs.

The ladder is designed to be perceptually distinct and implementable across light/dark/contrast themes.

Signed tierTokenCanonical nameIntended meaningTypical examples
−2--cem-recess-2Deep recessedinfrastructure far behind attentiondeep shell wells, backstage panels
−1--cem-recess-1Recessedback context behind workside navigation rail, filter plane
0--cem-elevation-0Baseground / canvasapp background, page canvas
+1--cem-elevation-1Raisedwork region separationcards, primary panels, editors
+2--cem-elevation-2Floatinginteractive lift / grouped focushover-lift regions, dragged items
+3--cem-elevation-3Overlaycontextual transient layermenus, tooltips, popovers, select lists
+4--cem-elevation-4Commandmust respond / modal decisiondialogs, blocking confirmations

2.4 Terminology disclaimer

  1. One consumer term: “layering” is the shared vocabulary for elevation and recess.
  2. Signed meaning: both “dig down” and “lift up” are first-class.
  3. Multiple channels: tone, contour, shadow, blur/material, space, and motion are coordinated.
  4. Theme resilience: the ladder works in light/dark/forced-colors.
  5. Avoid false importance: overlays can render above commands physically, but they must not steal semantic priority.

3. User-flow journey through layering

Layering is experienced as the user moves through a interaction flow.

3.1 Landing (orient)

[ Back layer ]   |  [ Work layer ]
(nav/context)    |  (primary content)

3.2 Scanning (compare)

3.3 Interacting (act)

3.4 Contextualizing (choose)

3.5 Deciding (commit)


4. Design goals


5. Signed ladder and planes

Layering is a composition of:

5.1 Planes

CEM defines five named planes (semantic layer roles). They are typically implemented with portals.

Normative rules

5.2 Physical stacking exceptions are allowed

A tooltip can render above a dialog while remaining an Overlay-tier element.

This is not a contradiction; it reflects two truths:


6. Token model (basis → endpoints → adapters)

CEM D4 defines three layers of contract.

6.1 Basis tokens (rungs)

Basis tokens are the minimal numeric “rungs.” They encode signed tier meaning.

6.2 Semantic endpoints (product-facing)

Semantic endpoints are what components use. They map to basis rungs.

6.3 Adapters (appearance channels)

Adapters describe how the rung is rendered:

Adapters can vary per theme/density without changing semantics.

6.4 Generator output shape (R-D4-1 resolved)

D4 emits the semantic-aliases shape, not per-channel adapter hooks:

D4 also emits the public physical choice-popup stacking integer (§15.1.1), separately from these rung recipes. Theme adapters compose the remaining appearance channels.

6.5 Per-rung perceivable channels (R-D4-2 resolved)

§7.2 requires each rung to differ from its neighbors in at least one perceivable channel (≥2 in dense UIs). D4 emits shadow as the canonical channel; tone is the second channel and is supplied per-theme by cem-colors.html (light/dark/contrast/native blocks). Together those two channels satisfy the rule in normal themes. In forced-colors: active themes, shadows are stripped — D4's forced-colors override collapses all rungs to none, and the tier signal is then carried by D5 contour (--cem-stroke-boundary-strong) and by spatial isolation. Browser-level verification of "≥1 perceivable channel change per rung" is performed in Phase 13.


7. Basis tokens: the canonical signed ladder

7.1 Required rung tokens

The 7-tier ladder rungs are required and must remain stable. Each rung emits as a box-shadow recipe (the canonical single channel — see §6.4). Recess rungs use inset recipes; lift rungs use outset recipes; the canvas base is none. Values are perceptually graded so each step differs visibly from its neighbors.

cem-layering-rungs
TokenValueDescriptiontier
--cem-recess-2inset 0 2px 4px rgba(0, 0, 0, 0.08), inset 0 1px 2px rgba(0, 0, 0, 0.04)Deep recessed (−2)required
--cem-recess-1inset 0 1px 2px rgba(0, 0, 0, 0.04)Recessed (−1)required
--cem-elevation-0noneBase / canvas (0)required
--cem-elevation-10 1px 2px rgba(0, 0, 0, 0.06), 0 1px 1px rgba(0, 0, 0, 0.04)Raised (+1) — work regionsrequired
--cem-elevation-20 2px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06)Floating (+2) — lift within workrequired
--cem-elevation-30 4px 8px rgba(0, 0, 0, 0.10), 0 2px 4px rgba(0, 0, 0, 0.08)Overlay (+3) — menus, tooltips, popoversrequired
--cem-elevation-40 8px 16px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.10)Command (+4) — dialogs, modal decisionsrequired

7.2 Appearance-change principle

When moving by one rung, at least one of the following must change in a perceivable way (and ideally two in high-density UI):

Recess should primarily use tone and contour (shadows are often imperceptible “into” the page).

Lift should primarily use tone + shadow, with contour as a fallback.


8. Semantic endpoints: product-facing contract

Semantic endpoints allow components to express layering without knowing numeric rungs.

8.1 Canonical endpoints

EndpointMaps to rungMeaning
--cem-layer-back--cem-recess-1back layer: context behind work
--cem-layer-base--cem-elevation-0canvas/base
--cem-layer-work--cem-elevation-1primary work regions
--cem-layer-overlay--cem-elevation-3contextual transient UI
--cem-layer-command--cem-elevation-4must respond: modal decision

Note: --cem-elevation-2 (Floating) is most often an internal component choice within the Work layer (e.g., a temporary lifted region), not a global plane.

cem-layering-semantic
TokenValueDescriptiontier
--cem-layer-backvar(--cem-recess-1)Back: context behind workrequired
--cem-layer-basevar(--cem-elevation-0)Canvas / baserequired
--cem-layer-workvar(--cem-elevation-1)Primary work regionsrequired
--cem-layer-overlayvar(--cem-elevation-3)Contextual transient UI (menus, tooltips)required
--cem-layer-commandvar(--cem-elevation-4)Modal / must-respond surfaces (dialogs)required

8.2 Optional endpoints

Optional endpoints are allowed only if they remain stable and scoped, and if they map cleanly to an existing rung without creating new “micro tiers”.

Examples:

cem-layering-semantic-optional
TokenValueDescriptiontier
--cem-layer-back-deepvar(--cem-recess-2)Back layer at deepest recessoptional
--cem-layer-work-floatingvar(--cem-elevation-2)Lifted affordance within work planeoptional

9. Representation channels

Layering cues are multi-channel. No single channel is reliable across all themes.

9.1 Tone and the color ladder

The CEM color ladder is the primary driver of “dig down” vs “lift up.”

Rules

9.2 Shadow

9.3 Contour / stroke

9.4 Material / blur

Where supported, material/blur can reinforce overlay separation, but MUST NOT replace tone/contrast requirements.

9.5 Space (inset and gap)

Layers with higher semantic priority SHOULD “earn” breathing room (inset and/or gap) in comfort density modes.

9.6 Motion

Lift/drop transitions MAY reinforce the ladder, but the meaning must remain clear in reduced-motion settings.


10. Scrim

Scrim communicates modality and commitment.

10.1 Scrim usage matrix

Layer roleTypical componentsScrimNotes
Back / Base / Worknav, contentnonescrim would reduce usability
Overlaymenus, popovers, tooltipsoptional (rare)only if overlay must strongly detach from busy content
Commanddialogs, blocking confirmationsrequiredcommand owns modality, focus trap, and dismissal precedence

10.2 Command owns modality


11. Action states must align with layering and the color ladder

11.1 Alignment rule: one direction, two dimensions

Layering (signed depth) and action states (visual priority order) must not contradict each other.

11.2 State escalation should not change layer role

State changes (hover, focus, pressed, selected, disabled, readonly) MUST NOT change the layer endpoint. They may adjust rung rendering (tone/contour/shadow) within a bounded range.

Action states must align with layering cues and color ladder direction.

A button becoming hovered does not become an Overlay. State changes should be expressed as micro-shifts within the component’s assigned layer role.

This guidance assumes the component’s base endpoint is correct.

11.4 Active/pressed tactile rule

Pressed feedback may reduce shadow (a “press in”), but MUST preserve the state’s prominence via tone/contour so the user does not read it as “disabled or background.”


12. Cross-dimension coupling

Layering relies on other dimensions for robustness:

Layering MUST NOT rename or duplicate these dimensions; it only defines coupling invariants.


13. Accessibility and forced-colors requirements

13.1 Depth is not the only signal

Layer meaning must remain readable without shadows and with limited color (e.g., high-contrast themes). Therefore:

13.2 Forced-colors

In forced-colors:

In forced-colors: active themes, shadows are stripped by the user agent. D4's generator collapses every rung's shadow recipe to none, and components rely on D5 contour (--cem-stroke-boundary-strong) plus spatial isolation to carry the tier signal.

cem-layering-rungs-forced
TokenForced-colors value
--cem-recess-2none
--cem-recess-1none
--cem-elevation-0none
--cem-elevation-1none
--cem-elevation-2none
--cem-elevation-3none
--cem-elevation-4none

cem-layering-rungs-forced is generator-only — no new tokens. The same rung names are redeclared inside @media (forced-colors: active) :root { … }.


14. Component mapping matrix

This matrix maps common component families to layer endpoints and their default rung.

Component familyLayer endpointDefault rungNotes
App shell (chrome)--cem-layer-back--cem-recess-1recessed context; low brand energy
Backstage wells (rare)--cem-layer-back--cem-recess-2use sparingly; avoid turning the UI into “tunnels”
Page canvas--cem-layer-base--cem-elevation-0ground / canvas
Main content panels--cem-layer-work--cem-elevation-1default work separation
Floating affordances (within work)--cem-layer-work--cem-elevation-2same object lifted (hover/drag)
Tooltip--cem-layer-overlay--cem-elevation-3may portal above dialogs; remains Overlay
Menu / popover / select list--cem-layer-overlay--cem-elevation-3portal/top-layer; dismiss precedence above dialog
Sheet (non-blocking)--cem-layer-overlay--cem-elevation-3optional scrim only if required
Dialog / confirmation--cem-layer-command--cem-elevation-4owns modality, scrim, focus trap
Toast / global banner--cem-layer-overlay--cem-elevation-3if it blocks progress, treat as Command

15. Implementation guidance

15.1 Keep semantics separate from z-index

15.1.1 Public choice-popup stacking

The theme owns the web choice-popup stacking value. This public physical stacking property is independent of semantic elevation: its integer is never a rung or priority tier. Containers and individual component hosts may override it; components consume it without redeclaring a local default.

cem-layering-popup-stacking
TokenValueDescriptiontier
--cem-select-popup-z-index1Integer stacking level for the positioned select/choice popup within its containing stacking contextrecommended

The default places the popup above later in-flow positioned content. It does not escape ancestor clipping or stacking contexts, establish a global overlay ladder, or replace top-layer/portal policy. Elevation tokens remain shadow recipes and MUST NOT be used as z-index values. The canonical select adopts this token; frozen legacy choice components retain their bounded private adapter until migration.

15.2 Example CSS pattern (illustrative)

The following demonstrates the mapping shape; it is not a required implementation.

/* Semantic endpoints select a rung; adapters render the rung. */

.cem-layer--work      { --cem-rung: var(--cem-elevation-1); }
.cem-layer--overlay   { --cem-rung: var(--cem-elevation-3); }
.cem-layer--command   { --cem-rung: var(--cem-elevation-4); }

/* Adapter hooks (tone/shadow/contour) are theme-specific. */
.cem-layer {
  background: var(--cem-layer-tone, Canvas);
  box-shadow: var(--cem-layer-shadow, none);
  outline: var(--cem-layer-contour, none);
}

15.3 Dismissal and focus precedence


16. Canonical token summary

16.1 Required rung tokens

16.2 Required semantic endpoints

16.3 Optional semantic endpoints (allowed)


17. Governance and versioning

17.1 Breaking (major)

Treat as breaking if you:

17.2 Non-breaking (minor/patch)

Treat as minor/patch if you:


18. Migration notes

This spec is the canonical D4 contract for layering (signed depth).


19. Token manifest index

Source tableSectionDescription
cem-layering-rungs§7.17 basis rungs as box-shadow recipes (--cem-recess-{2,1}, --cem-elevation-{0..4})
cem-layering-semantic§8.15 required semantic endpoints (--cem-layer-{back,base,work,overlay,command})
cem-layering-semantic-optional§8.22 optional endpoints (--cem-layer-{back-deep,work-floating})
cem-layering-popup-stacking§15.1.1Public physical choice-popup stacking integer
cem-layering-rungs-forced§13.2Forced-colors rung override values (generator-only; no new tokens)

Generator derivation rules:


20. References

Internal

External