Elevation System
Shadow depths and surface tints, generated from a single chromatic shadow DNA.
The Elevation System generates shadow and surface tokens that create visual depth. There are four numeric levels with semantic aliases (rest / lifted / overlay / modal), a vocabulary small enough that people and AI agents pick from a fixed set — there is no elevation-7.
How It Works
The engine produces these token groups:
- Shadow DNA —
--fp-shadow-tint(flat and liquid-glass),--fp-shadow-light+--fp-shadow-dark(neumorphic), or--fp-shadow-hard(brutalism). - Elevation levels —
--fp-elevation-{1..4}. In the DTCG export each level also carries intent metadata in$extensions. - Semantic aliases —
--fp-elevation-{rest|lifted|overlay|modal},var()references to levels 1–4 (add names or remap them withelevation.levelAliases; the four default names always remain, through every entry point, because components read them). - Composite elevation — the shadow and surface tint for each level, in the DTCG export only. DTCG has no elevation type, so they are in
$extensions["com.flexpixels"]on thecomposite-elevationgroup. - Surface tints —
--fp-surface-tint-{1..4}neutral overlays (flat and liquid-glass styles only).
Style in this site's theme: auto (resolves to flat)
Levels with intent
| Level | Aliases | CSS variable | Intent |
|---|---|---|---|
| 1 | rest | --fp-elevation-1 | Resting depth — barely lifted, suggests a surface boundary. |
| 2 | lifted | --fp-elevation-2 | Lifted depth — actively raised, signals interactivity or affordance. |
| 3 | overlay | --fp-elevation-3 | Overlay depth — floats above page content; clearly detached. |
| 4 | modal | --fp-elevation-4 | Modal depth — top of the surface ladder; commands attention. |
Read flexpixels://elevation/levels/{key} from the Cortex MCP server for
whenToUse / whenNotToUse / examples per level.
Style modes
elevation.style swaps the underlying shadow math without changing the level vocabulary. The default, auto, behaves like flat unless an elevation.scenario picks another style.
auto active Best for: The default. Renders as flat. Setting elevation.scenario replaces it with that scenario's style, unless the config also sets style.
Tradeoff: No look of its own: the output is the same as 'flat'.
flat Best for: Most product UIs. Directional drop shadows with chromatic tint.
Tradeoff: Predictable, low-risk, supported everywhere.
neumorphic Best for: Editorial layouts and gentle hierarchy without harsh edges.
Tradeoff: Low contrast — conflicts with AAA accessibility; needs CSS relative colors.
liquid-glass Best for: Layered dashboards and marketing heroes where panels float above content.
Tradeoff: Needs backdrop-filter for the blur; without it panels stay translucent but unblurred. Reduced transparency, high contrast and forced colours make them opaque.
brutalism Best for: Distinctive marketing CTAs and accent panels.
Tradeoff: Aesthetic — not for dense UI; ≥3px offset to read as 'brutalist'.
MCP tools (for AI agents)
The elevation tools on the MCP server — call them when wiring depth into a component or checking an existing config:
| Tool | Description |
|---|---|
compute_elevation | Compute the full elevation system. Pass `intent` or override style + style-specific knobs. Returns 4 resolved levels with intent metadata, semantic aliases, CSS preview, soft warnings, rationale. |
validate_elevation | Validate elevation against guidance. Vet a candidate config, scan an HTML fragment's inline box-shadow declarations, or scan raw CSS for hard-coded shadows that bypass tokens. |
suggest_elevation_style | Suggest 3 candidate style configurations tuned to an intent (marketing/app/editorial/dashboard) and optional contrastFloor hint. Each candidate includes rationale, warnings, ready-to-paste config slice. |
pair_elevations_with_typography | Cross-domain pairing. Pass a typography intent and get back an elevation config that complements the type vocabulary (restrained shadows under dramatic type; carrying hierarchy under quieter type). |
How to Use
Card with elevation
.card {
background: var(--fp-neutral-2);
border-radius: var(--fp-corner-surface);
box-shadow: var(--fp-elevation-1);
padding: var(--fp-s-6);
}
.card:hover {
box-shadow: var(--fp-elevation-2);
}Modal / dialog
.modal-overlay {
background: var(--fp-black-a5);
}
.modal {
background: var(--fp-neutral-1);
border-radius: var(--fp-corner-overlay);
box-shadow: var(--fp-elevation-4);
padding: var(--fp-s-8);
}Dropdown menu
.dropdown {
background: var(--fp-neutral-2);
border-radius: var(--fp-corner-surface);
box-shadow: var(--fp-elevation-3);
border: 1px solid var(--fp-neutral-6);
}Depth progression (card → dropdown → modal)
.card {
box-shadow: var(--fp-elevation-1);
} /* 1 — resting */
.dropdown {
box-shadow: var(--fp-elevation-3);
} /* 3 — above cards */
.modal {
box-shadow: var(--fp-elevation-4);
} /* 4 — above everything */Surface tinting for subtle hierarchy
.page {
background: var(--fp-neutral-1);
}
.sidebar {
background: var(--fp-neutral-1);
background-image: var(--fp-surface-tint-2);
}
.panel {
background: var(--fp-neutral-1);
background-image: var(--fp-surface-tint-3);
}Gradient surfaces from config
Each tint is one flat colour by default. elevation.tintGradient turns it into a
gradient: twice the lift at the lit edge, fading to nothing, so a surface keeps
its average lift and gains a direction. With source: "primary" the lift takes
the brand’s hue, a glow. Every surface that paints a tint follows (a solid
fp-card, for one), with no per-component styling:
{
"seeds": { "surface": { "dark": "#050809" } },
"elevation": { "tintGradient": { "angle": 160, "source": "primary" } }
}A near-black surface anchor with a primary gradient is the usual dark
dashboard look: the ground recedes, and raised cards catch a little brand light.
Scheme-aware shadows
--fp-shadow-tint is emitted as a light-dark() pair so depth reads in both schemes:
--fp-shadow-tint: light-dark(
oklch(from var(--fp-neutral-9) 0.1 0.01 h / 0.12),
/* light: tinted, low opacity */ oklch(0 0 0 / 0.4) /* dark: near-black halo */
);In light mode the shadow is a dark, slightly tinted colour at shadowIntensity opacity, with tintChroma as its chroma. That same 0.12 tint is invisible on a dark surface (L≈0.15) — there is no lighter background for it to darken — so dark mode needs a much more opaque, near-black halo instead. elevation.shadowIntensityDark (default 0.4) controls that dark opacity independently of the light shadowIntensity, and every --fp-elevation-{1..4} step composes over the scheme-aware tint automatically.
State layers
For interactive elevated surfaces, pair elevation with the Material-3 state-layer opacities from the interaction system — --fp-state-hover (0.05) and --fp-state-press (0.1), plus --fp-state-drag (0.14) and --fp-state-selected (0.08) from the full stylesheet. Composited as currentColor, they flip with the color scheme, so a hovered card gets a consistent overlay in both light and dark without extra tokens.
Configuration
{
"elevation": {
"shadowIntensity": 0.12,
"shadowIntensityDark": 0.4,
"tintChroma": 0.01
}
}| Property | Default | Effect |
|---|---|---|
shadowIntensity | 0.12 | Shadow tint opacity in light mode (0–1). Higher = darker shadows. |
shadowIntensityDark | 0.4 | Shadow tint opacity in dark mode (0–1). Near-black halo so depth reads on dark surfaces. |
tintChroma | 0.01 | Chroma of shadow tint (0–0.05). 0 = pure gray, 0.05 = vivid colored shadows. |
tintGradient | unset | { angle, source }: surface tints run at angle (deg) from twice the lift to nothing; source neutral or primary. |
style | "auto" | auto, flat, neumorphic, liquid-glass or brutalism (see below). |
levelAliases | { rest: 1, lifted: 2, overlay: 3, modal: 4 } | Semantic names for the numeric levels. |
scenario | unset | marketing, app, editorial or dashboard: a preset bundle of style and intensity; your explicit fields still win. |
surfaceAware | false | Also emit --fp-elevation-{level}-on-{app|subtle|ghost|image} variants (flat and liquid-glass only). |
The theme-config.json reference lists the rest (glow, ambient, perceptual, scales, levelMetadata).
Design Language Modes
The elevation engine produces different token sets depending on elevation.style. The default (auto, which acts as flat) is a directional drop-shadow model. Three alternative modes are available:
Neumorphic
Set via elevation.style: "neumorphic". Generates dual opposing shadows (a lighter and a darker shade of the page colour) for a soft, extruded look. Adds --fp-elevation-inset-1..4 for pressed states. Neumorphic shadows are low-contrast by nature; the engine warns if you combine them with accessibility: "AAA".
{ "elevation": { "style": "neumorphic", "neumorphicDepth": 0.1 } }Brutalism
Set via elevation.style: "brutalism". Generates hard-offset shadows with zero blur in the colour of neutral step 12 — raw, graphic, high-contrast. Levels 2–4 multiply brutalismOffset by 1.5, 2 and 3.
{ "elevation": { "style": "brutalism", "brutalismOffset": 4 } }Liquid Glass
Set via elevation.style: "liquid-glass". Keeps the flat drop-shadow ladder and makes the component surfaces themselves translucent: cards, sections and panels get a see-through fill, a backdrop blur and a glass edge, from the config alone. Under prefers-reduced-transparency, prefers-contrast: more and forced colours the surfaces turn opaque again.
The --fp-glass-* tokens are emitted with every style, so you can build a glass panel by hand in any theme. The default theme.css has all of them except --fp-glass-bg-subtle and --fp-glass-inner-glow, which are in the full stylesheet only. Their defaults come from backdropBlur (12) and glassOpacity (0.7):
| Token | Default | Purpose |
|---|---|---|
--fp-glass-backdrop-blur | blur(12px) saturate(140%) | backdrop-filter — blur + saturation boost |
--fp-glass-bg | --fp-surface-app at glassOpacity | Semi-transparent frosted surface fill |
--fp-glass-bg-subtle | --fp-surface-app at a quarter of that, to two decimals (0.18 for 0.7) | For ghost/outline variants |
--fp-glass-bg-solid | var(--fp-surface-element) | Opaque fallback for reduced transparency |
--fp-glass-highlight | two-layer inset | Top specular + bottom shade |
--fp-glass-border | light-dark(white 45%, white 10%) | Specular rim |
--fp-glass-inner-glow | inset, --fp-white-a3 | Soft inner light |
.glass-panel {
background: var(--fp-glass-bg);
backdrop-filter: var(--fp-glass-backdrop-blur);
border: 1px solid var(--fp-glass-border);
box-shadow: var(--fp-elevation-1), var(--fp-glass-highlight);
}
/* --fp-glass-bg stays translucent: a hand-built panel turns opaque itself. */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
.glass-panel {
background: var(--fp-glass-bg-solid);
backdrop-filter: none;
}
}{ "elevation": { "style": "liquid-glass", "backdropBlur": 14, "glassOpacity": 0.65 } }Best Practices
-
Match the level to the layer. Level 1 (
rest) for resting surfaces, 2 (lifted) for hover or raised, 3 (overlay) for dropdowns and popovers, 4 (modal) for dialogs. -
Add
transitionfor smooth elevation changes. Cards that change shadow on hover look better with:transition: box-shadow var(--fp-transition-duration) var(--fp-transition-easing); -
Pair elevation with a border for clarity. On light backgrounds, a subtle border helps define edges:
border: var(--fp-stroke-control) solid var(--fp-border-subtle-color); -
Reach for surface tints on non-white surfaces. On tinted or dark backgrounds a shadow barely shows; a
--fp-surface-tint-{2..3}layer over the background can carry the depth instead (--fp-surface-tint-4is in the full stylesheet only).