Skip to content

Elevation, materials, and gradients ​

GHO-64 recipes on top of the token catalog. Components consume semantic --ghost-* variables; these data-elevation, data-material, and data-gradient attributes are documented utilities in @ghostvue/themes default CSS. They are not per-component tokens and they are not passthrough props.

Light and dark are nested data-ghost-mode scopes. Unset mode still follows prefers-color-scheme.

Elevation ​

Six levels, 0 through 5. Each level is a surface fill, a layered box-shadow (ambient plus key light, tinted with the neutral hue in oklch with alpha), and a hairline border. Dark mode lifts the fill, de-emphasizes the shadow, and adds an inset top highlight.

html
<article data-elevation="2">Raised card</article>

Light

0Flush
1Rest
2Raised
3Popover
4Dialog
5Highest

Dark

0Flush
1Rest
2Raised
3Popover
4Dialog
5Highest

Hairline borders ​

border.hairline is an alpha color. border.hairline.width is 1px at 1x and 0.5px under min-resolution: 2dppx, so high-DPR screens paint one device pixel.

Materials ​

solid is an opaque fill. glass uses backdrop-filter blur and a saturation boost, a translucent surface, and an inline SVG feTurbulence noise overlay (no network image). @supports swaps glass to material.glass.fallback.bg when backdrop-filter is missing. grain is a stronger noise overlay on an opaque fill. Forced colors drop blur, noise, and translucency.

html
<div data-gradient="aurora">
  <article data-material="glass">Glass on aurora</article>
</div>

Light

Solid
Glass
Grain

Dark

Solid
Glass
Grain

Gradients ​

Accent and aurora tokens interpolate in oklch. The gradient-border recipe uses mask-composite: exclude (with -webkit-mask-composite: xor) on ::before. Where mask-composite is unavailable, the padding-box / border-box double-background fallback is used.

html
<article data-gradient="accent">Accent</article>
<article data-gradient="aurora">Aurora</article>
<article data-gradient="border">Gradient border</article>

Light

Accent
Aurora
Border

Dark

Accent
Aurora
Border

Override the semantic variables rather than restyling the recipe internals:

css
.product-theme {
  --ghost-elevation-2-shadow: 0 8px 24px oklch(0.25 0.03 258 / 0.18);
  --ghost-gradient-accent: linear-gradient(in oklch, #7c3aed, #06b6d4);
}