Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic

Surfaces

A surface is a set of inherited UI tokens (--pm-sf-*). Components only read these tokens, so every component supports every surface automatically.

flat

Solid surfaces, hairline borders, soft elevation. The default.

Invite teammates

outline

Transparent fills with strong 3:1 borders. Great for dense tools.

Invite teammates

gradient

OKLCH gradients from the accent and secondary hues, with a sheen on solid controls.

Invite teammates

glass

Backdrop blur, translucent tint and a specular edge. Falls back to opaque with prefers-reduced-transparency or without blur support.

Invite teammates

neumorphic

Dual light/dark shadows from the canvas colour. Always keeps a visible boundary for WCAG 1.4.11.

Invite teammates

Controls

Nothing about a surface is fixed. Where the light comes from, how far, soft and dark shadows are, how wide borders are, and what glass, gradient and neumorphic surfaces are made of: each is a control you set, or leave to the theme. Try them:

Light and shadows
Borders
Neumorphic
Invite teammates
Elevation 1
Elevation 3
Elevation 5

Three ways to set them

In the theme, for the whole app. The generator has the same sliders and writes this for you:

import { defineTheme } from '@prismora/theme'; export default defineTheme({ "seed": "#7c5cff", "surface": "neumorphic", "shadow": { "angle": 315, "depth": 1.5 } });

In CSS, on the root or on anything that has data-surface (or a component's surface). The nearest one wins, so one card or one section can differ from the rest:

<section data-surface="neumorphic" style="--pm-light-angle: 315deg; --pm-shadow-depth: 1.5"> … </section>

By the people who use your app, saved with their other display choices. This site's Display settings do it this way (Fine-tune):

import { STYLE_CONTROLS, ThemeController } from '@prismora/theme'; const theme = new ThemeController(); theme.tune({ '--pm-shadow-depth': 1.5, '--pm-light-angle': 315 }); // saved, applied before first paint next time theme.tune({ '--pm-shadow-depth': null }); // back to the theme's value // STYLE_CONTROLS lists every control with its label, range, step and default: build your own sliders from it.

Every control

In a themeCustom propertyWhat it doesRangeWhen not set
shadow.angle--pm-light-angleWhere the light comes from: 0 is above (shadows fall straight down), 90 from the right, 315 from the top left. Shadows, glass and gloss highlights follow it.0 to 360 deg0deg (neumorphic: 315deg)
shadow.depth--pm-shadow-depthHow far shadows reach: 1 as designed, 0 no shadows, 2 twice as far.0 to 31
shadow.softness--pm-shadow-softnessHow much shadows blur: 1 as designed, 0 a hard edge.0 to 31
shadow.strength--pm-shadow-strengthHow dark shadows are: 1 as designed, 0 invisible.0 to 31
border.width--pm-border-widthThe line around surfaces, fields and controls, in pixels.0 to 4 px1px
glass.blur--pm-glass-blurHow much the glass blurs what is behind it. glass only.0 to 60 px18px
glass.opacity--pm-glass-opacityHow much of the glass is its own colour: 100 is solid. glass only.0 to 100 %58%
glass.saturation--pm-glass-saturationHow vivid the colours behind the glass become: 100 leaves them as they are. glass only.100 to 300 %170%
glass.sheen--pm-glass-sheenThe highlight across the glass: 1 as designed, 0 none. glass only.0 to 31
glass.edge--pm-glass-edgeHow bright the rim of the glass is: 1 as designed, 0 none. glass only.0 to 31
glass.backdrop--pm-glass-backdropHow much colour the page behind the glass carries: 1 as designed, 0 a plain page. glass only.0 to 31
gradient.angle--pm-gradient-angleThe direction the gradient runs in, like a CSS gradient: 180 runs down, 90 to the right. gradient only.0 to 360 deg150deg
gradient.strength--pm-gradient-strengthHow much colour the gradient carries: 1 as designed, 0 none. gradient only.0 to 1.31
gradient.sheen--pm-gradient-sheenThe gloss on buttons and other solid fills: 1 as designed, 0 none. gradient only.0 to 31
neumorphic.highlight--pm-neu-highlightHow bright the lit edge is: 1 as designed, 0 none. Shadow strength sets the shaded edge. neumorphic only.0 to 31
neumorphic.curve--pm-neu-curveThe shape of the face: 0 flat, 1 rounded out (convex), -1 hollowed (concave). neumorphic only.-1 to 10
shadow.color--pm-shadow-inkThe colour shadows are made of. Strength decides how much of it shows.any coloura dark tone of the neutral hue, black in dark mode
glass.tint--pm-glass-tintThe colour of the glass. glass only.any colourthe surface colour
gradient.from--pm-gradient-fromThe colour the gradient starts with. gradient only.any colourthe soft accent colour
gradient.to--pm-gradient-toThe colour the gradient ends with. gradient only.any colourthe soft secondary colour
neumorphic.light--pm-neu-lightThe colour of the lit edge. neumorphic only.any colourwhite
neumorphic.base--pm-neu-baseThe colour of the page and of everything made from it. neumorphic only.any colourthe canvas colour, a tone darker in light mode and lighter in dark mode

Shadows are also three tokens you can read in your own CSS: --pm-shadow-x and --pm-shadow-y (the direction, times the depth) and --pm-shadow-blur. Every elevation (--pm-elevation-1 to 5) is built from them, so your own shadows can follow the same light.

A border narrower than one pixel, or shadows with no strength, can leave a surface without a visible edge. The defaults meet WCAG 1.4.11; check contrast again when you go below them.

Usage

<!-- whole app --> <html data-surface="glass"> <!-- one region or one component --> <section data-surface="neumorphic">…</section> <pm-card surface="gradient">…</pm-card>

A surface set on the whole app draws the page too: the colour behind glass, the tone neumorphic is made of. A region with a surface of its own keeps the page it is on; add class="pm-surface-page" to give it that surface's page.

What follows the surface

Everything a component paints is one of the roles below, and every surface defines every role. The page, the app shell (sidebar, app bar, tab bar), cards, tables, fields, tracks, menus and dialogs all read them, so one attribute changes the whole app. Colours that carry meaning stay as they are: tone fills (badges, alerts, status), text, icons and chart ink.

TokenWhat it paints
--pm-sf-pageThe page: the colour everything sits on.
--pm-sf-page-imageA layer over the page colour (what shows through glass), or none.
--pm-sf-bgA container: card, panel, table, list.
--pm-sf-imageA layer over a container (gradient, sheen, curve), or none.
--pm-sf-borderThe line around a container, bar or floating layer.
--pm-sf-shadowThe shadow of a container.
--pm-sf-lift-1The shadow of a container with elevation="1": the lowest.
--pm-sf-lift-2The shadow with elevation="2".
--pm-sf-lift-3The shadow with elevation="3".
--pm-sf-lift-4The shadow with elevation="4".
--pm-sf-lift-5The shadow with elevation="5": the highest.
--pm-sf-backdropThe backdrop-filter of a container, or none.
--pm-sf-opaqueA container colour that hides what scrolls under it: sticky headers, pinned columns, rings around avatars and badges.
--pm-sf-subtleA quiet fill inside a container: table head, group row, footer.
--pm-sf-wellA recessed track or chip: segmented control, progress track, skeleton, inline code.
--pm-sf-well-shadowThe shadow of a recessed track (pressed in on neumorphic, a ring on outline), or none.
--pm-sf-neutralThe fill of neutral things that carry no tone: a neutral badge or button, an avatar, a count.
--pm-sf-hoverThe fill under the pointer on rows, items and quiet buttons.
--pm-sf-activeThe fill while such a row or item is pressed.
--pm-sf-region-bgA bar or side panel at the edge of the page: app bar, sidebar, tab bar.
--pm-sf-region-shadowThe shadow of a bar or side panel, and of a panel that sits in a container (table, list box, choice card), or none.
--pm-sf-region-backdropThe backdrop-filter of a bar or side panel, or none.
--pm-sf-float-bgA layer above the page: menu, popover, dialog, drawer, toast, tooltip card.
--pm-sf-float-shadowThe shadow of a layer above the page.
--pm-sf-float-backdropThe backdrop-filter of a layer above the page, or none.
--pm-sf-modal-shadowThe shadow of a modal layer over the dimmed page (dialog, drawer, command palette, bottom sheet): on neumorphic a crisp bevel and drop shadow, as the light shadow of a raised piece would glow on the dim.
--pm-sf-control-bgA text field or select.
--pm-sf-control-borderThe line around a field (3:1 against the page).
--pm-sf-control-shadowThe shadow of a field, a drop zone or an empty slot (pressed in on neumorphic), or none.
--pm-sf-raise-bgThe face of a raised piece: switch and slider thumb, the selected segment or pill.
--pm-sf-raiseThe shadow of a raised piece or button.
--pm-sf-pressThe shadow of a button while pressed.
--pm-sf-line-raiseThe shadow of a small piece that is flat on other surfaces (outline and ghost button, badge, tag, key, toggle, step, chat bubble, timeline marker, today in a calendar): raised where every piece is, none where its line or fill is enough.
--pm-sf-line-pressThe same piece while pressed or on (a pressed toggle, the chosen day), or none.
--pm-sf-hover-shadowThe shadow of a row, option or item under the pointer or the keyboard (menu, list box, table row, nav item): it rises on neumorphic, or none where the hover fill is enough.
--pm-sf-grooveThe colour of a dividing line: the border colour, or on neumorphic the shaded edge, so with sf-groove-lit under it the line is cut into the surface.
--pm-sf-groove-litThe lit edge under a dividing line, which engraves it into the surface (neumorphic), or transparent.
--pm-sf-mark-filterA filter on drawn marks (chart bars, lines and slices, sparklines): none, or on neumorphic a soft lit and shaded edge that lifts them off the page.
--pm-sf-mark-trackWhether a chart draws the slot each bar rises in: 1 on neumorphic (pressed into the surface), 0 elsewhere.
--pm-sf-bezelThe shadow of a small round indicator (a status dot): none, or on neumorphic a raised ring of the surface around it.
--pm-sf-track-minThe least height of a thin track (progress, meter, slider), so its groove reads on neumorphic; 0px elsewhere.
--pm-sf-joined-shadowThe shadow of a piece inside a joined group (button group): initial keeps the piece's own shadow (read as var(--pm-sf-joined-shadow, <own>)); on neumorphic the group rises as one, so its pieces have none and their seams stay flat.
--pm-sf-solid-imageA layer over solid colour fills (gloss), or none.
--pm-sf-soft-mixHow much of a soft tone fill is its own colour (less on glass).

In your own CSS, paint with these instead of a fixed colour and your components follow the surface too:

.my-panel { background: var(--pm-sf-image), var(--pm-sf-bg); border: var(--pm-border-width, 1px) solid var(--pm-sf-border); box-shadow: var(--pm-sf-shadow); backdrop-filter: var(--pm-sf-backdrop); } .my-toolbar { background: var(--pm-sf-region-bg); backdrop-filter: var(--pm-sf-region-backdrop); } .my-row:hover { background: var(--pm-sf-hover); box-shadow: var(--pm-sf-hover-shadow); }

To create your own surface, define every token of the table under a selector such as [data-surface="paper"]. In TypeScript, Record<SurfaceToken, string> from @prismora/theme tells you when one is missing.