Elevation

Elevation tokens are the shadows that lift a surface above the page, the focus effects on controls, and the overlays that dim the page behind a modal. Use them to show what floats and what has focus.

  • Beta
  • Accessibility
  • Figma Effect styles (components/*) and Mapped overlay/*
  • packages/tokens/src/figma/snapshot.json, src/interim/shadow.json

Beta. All shadows except one are Figma effect styles; regular-shadow-small is interim because Figma only has it in a remote library (TD-14, FC-16). The focus effects measure about 1.1:1 against white and need an approved accessible ring before Stable (C5). The overlay colours are Figma variables.

Overview

Nuton is a flat, light interface. Most surfaces sit on the page with a 1px Stroke/Soft-200 border; a shadow says that something floats above the content, such as a menu, a popover or the command search. The higher the surface, the softer and wider its shadow.

Regular shadows: one soft layer

x-small
small
medium

Custom shadows: layered, with a hairline ring

x-small
small
medium
large
tooltip
chat

Regular shadows are a single soft drop. Custom shadows stack several drops with a 1px ring and an inner bottom edge, so a surface reads as raised even without a border. Today components use the regular set; the custom set has no component yet.

Tokens

Every value below is generated from @nuton/tokens. Shadows are Figma effect styles under components/; the group prefix is dropped in the name (custom-shadows/large becomes --nu-shadow-custom-shadows-large).

Regular shadows

Regular shadow tokens
PreviewTokenValueSource
--nu-shadow-regular-shadow-x-small0px 1px 2px 0px #0a0d1408FigmaEffectStyle/components/regular-shadow/x-small
--nu-shadow-regular-shadow-small0px 2px 4px 0px #1b1c1d0aInterim
--nu-shadow-regular-shadow-medium0px 16px 32px -12px #0e121b1aFigmaEffectStyle/components/regular-shadow/medium

regular-shadow-small is interim: Chart legend dots and Avatar status badges use the remote style regular-shadow/small, which has no local Figma effect style yet (TD-14, FC-16).

Custom shadows

Custom shadow tokens
PreviewTokenValueSource
--nu-shadow-custom-shadows-x-small0px 1px 2px 0px #3333330a, 0px 2px 4px 0px #3333330a, 0px 4px 8px -2px #3333330f, 0px 0px 0px 1px #3333330a, inset 0px -1px 1px -0.5px #3333330fFigmaEffectStyle/components/custom-shadows/x-small
--nu-shadow-custom-shadows-small0px 1px 3px -1.5px #33333329, 0px 5px 5px -2.5px #33333314, 0px 12px 6px -6px #33333305, 0px 16px 8px -8px #33333303, 0px 0px 0px 1px #3333330a, inset 0px -0.5px 0.5px 0px #33333314FigmaEffectStyle/components/custom-shadows/small
--nu-shadow-custom-shadows-medium0px 48px 48px -24px #3333330a, 0px 24px 24px -12px #3333330a, 0px 12px 12px -6px #3333330a, 0px 6px 6px -3px #3333330a, 0px 3px 3px -1.5px #33333305, 0px 1px 1px 0.5px #3333330a, 0px 0px 0px 1px #3333330a, inset 0px -1px 1px -0.5px #3333330fFigmaEffectStyle/components/custom-shadows/medium
--nu-shadow-custom-shadows-large0px 96px 96px -32px #3333330f, 0px 48px 48px -24px #3333330a, 0px 24px 24px -12px #3333330a, 0px 12px 12px -6px #3333330a, 0px 6px 6px -3px #3333330a, 0px 3px 3px -1.5px #33333305, 0px 1px 1px 0.5px #3333330a, 0px 0px 0px 1px #3333330a, inset 0px -1px 1px -0.5px #3333330fFigmaEffectStyle/components/custom-shadows/large
--nu-shadow-custom-shadows-tooltipinset 0px -1px 1px -0.5px #1717170f, 0px 0px 0px 1px #ebebebff, 0px 48px 48px -24px #1717170a, 0px 24px 24px -12px #1717170a, 0px 12px 12px -6px #1717170a, 0px 6px 6px -3px #1717170a, 0px 3px 3px -1.5px #17171705, 0px 1px 1px 0.5px #1717170aFigmaEffectStyle/components/custom-shadows/Tooltip
--nu-shadow-custom-shadows-chat0px 0px 0px 1px #17171705, 0px 1px 1px -0.5px #17171705, 0px 3px 3px -1.5px #17171705, 0px 4px 6px -10px #17171705FigmaEffectStyle/components/custom-shadows/Chat

Tooltip and Chat keep Figma's capitalised style names (custom-shadows/Tooltip, custom-shadows/Chat); the casing clean-up is part of TD-09.

Focus effects

Focus effect tokens
PreviewTokenValueSource
--nu-shadow-buttons-primary-focus0px 0px 0px 4px #476cff1a, 0px 0px 0px 2px #ffffffffFigmaEffectStyle/components/buttons/primary-focus
--nu-shadow-buttons-important-focus0px 0px 0px 4px #99a0ae29, 0px 0px 0px 2px #ffffffffFigmaEffectStyle/components/buttons/important-focus
--nu-shadow-buttons-error-focus0px 0px 0px 4px #fb37481a, 0px 0px 0px 2px #ffffffffFigmaEffectStyle/components/buttons/error-focus

Each is a 2px white gap plus a 4px tinted halo. On white the halo is barely visible (about 1.1:1, C5); see Accessibility.

Component shadows

Component shadow tokens
PreviewTokenValueSource
--nu-shadow-fancy-buttons-neutral0px 0px 0px 1px #242628ff, 0px 1px 2px 0px #1b1c1d7aFigmaEffectStyle/components/fancy-buttons/neutral
--nu-shadow-fancy-buttons-primary0px 0px 0px 1px #1daf61ff, 0px 1px 2px 0px #0e121b3dFigmaEffectStyle/components/fancy-buttons/primary
--nu-shadow-fancy-buttons-error0px 0px 0px 1px #e93544ff, 0px 1px 2px 0px #0e121b3dFigmaEffectStyle/components/fancy-buttons/error
--nu-shadow-fancy-buttons-stroke0px 0px 0px 1px #ebebebff, 0px 1px 3px 0px #0e121b1fFigmaEffectStyle/components/fancy-buttons/stroke
--nu-shadow-toggle-switch0px 2px 4px 0px #0e121b08, 0px 6px 10px 0px #0e121b0fFigmaEffectStyle/components/toggle/switch

Fancy-button shadows come from Figma but no @nuton/ui component uses them yet. toggle-switch lifts the switch thumb.

Overlays

Overlay colour tokens
PreviewTokenValueSource
--nu-overlay-gray#3333333dFigmaMapped/overlay/overlay-gray
--nu-overlay-slate#2b303b3dFigmaMapped/overlay/overlay-slate

Figma names these overlay/overlay-gray and overlay/overlay-slate; the repeated prefix is collapsed in code (TD-05, rename queued in TD-09). Overlays sit on --nu-z-overlay, under the dialog on --nu-z-modal (code-only, see Layout).

Usage

css
/* A floating panel: border + shadow, like the Nuton menus */
.lesson-popover {
  border: 1px solid var(--nu-stroke-soft-200);
  border-radius: var(--nu-radius-16);
  background: var(--nu-bg-white);
  box-shadow: var(--nu-shadow-regular-shadow-medium);
}

/* The dimmed page behind a modal */
.lesson-dialog__overlay {
  position: fixed;
  inset: 0;
  background: var(--nu-overlay-gray);
  z-index: var(--nu-z-overlay);
}

Every shadow is a shadow-* utility in both Tailwind outputs (for example shadow-custom-shadows-tooltip, shadow-toggle-switch). Overlays are colours: bg-overlay-gray, bg-overlay-slate. The v3 preset also has z-overlay; the v4 theme has no z-index utilities, so use var(--nu-z-overlay) there.

Choosing a token

  • Resting controls (text areas, digit inputs, key icons, avatar groups): regular-shadow-x-small, always with a border.
  • Floating panels (dropdown menus, combobox lists, command search): regular-shadow-medium with a 1px Stroke/Soft-200 border.
  • Tiny marks on busy backgrounds (chart legend dots, status badges): regular-shadow-small (interim).
  • Focus: the buttons/*-focus effect that matches the control's intent (important for neutral, primary, error). Don't use a focus effect for elevation.
  • Behind a modal: overlay-gray, the one in use. overlay-slate is a cooler alternative with no documented use yet.

In use

Real @nuton/ui components, each reading its shadow from a token.

Floating menu

Open the menu. The panel uses regular-shadow-medium and a border; the switch thumb uses toggle-switch.

Overlay behind a modal

Open the search. overlay-gray dims the page and the panel floats on regular-shadow-medium. Press Escape to close; focus returns to the button.

Resting fields and focus

The text area rests on regular-shadow-x-small. Tab into either field to see the buttons/important-focus effect.

Shown on the lesson card.

Focus effects by intent

Tab through the buttons. Each intent has its own focus effect: important (neutral), primary and error.

Small surfaces

Key icon
Key icon
CompletedIn progress
Legend dots
Switch thumb

Where components use each token

TokenUsed by
--nu-shadow-regular-shadow-x-smallTextarea, Digit input, inline Input when invalid, Key icon (stroke), compact Avatar group, menu media frames
--nu-shadow-regular-shadow-smallChart legend dot; Avatar status badges (see the warning below)
--nu-shadow-regular-shadow-mediumDropdown menu, Combobox list, Command menu panel
--nu-shadow-buttons-important-focusButton (neutral), Input, Textarea, Digit input
--nu-shadow-buttons-primary-focusButton (primary)
--nu-shadow-buttons-error-focusButton (error); invalid Input, Textarea and Digit input
--nu-shadow-toggle-switchSwitch thumb in menu switch items
--nu-overlay-grayCommand menu backdrop
Custom shadows, fancy buttons, --nu-overlay-slateNo @nuton/ui component yet

Fixed: Avatar status badge shadow

Avatar used to apply regular-shadow-small through filter: drop-shadow(). That function doesn't accept the token's spread value, so browsers dropped it. The badge's white ring now uses box-shadow, which renders the token as designed.

Accessibility

Focus visibility

The buttons/*-focus effects measure about 1.1:1 against white, below the 3:1 Stable gate (C5). Components use them as Figma specifies. An accessible ring is ready as --nu-focus-ring-color (State/Primary/Base, 5.59:1) but isn't applied until it's approved.

Shadows never carry meaning alone

Shadows are faint and vanish in Windows High Contrast (forced-colors). Floating panels also have a 1px border, and Button, Input and menu items switch to a system Highlight outline there, so focus and edges stay visible.

Overlays and modals

overlay-gray is decoration; it doesn't make a page inert. The Command menu traps focus, closes on Escape and returns focus to its opener. Any custom modal on an overlay must do the same.

You must: pair a floating surface's shadow with a border; keep the component's focus effect (don't remove it with box-shadow: none); manage focus in anything shown on an overlay.

Guidelines and related

Use a shadow for

  • Surfaces that float over content: menus, popovers, the command search.
  • A light lift on resting controls that need to read as tappable, like text areas and key icons.
  • Focus, through the component's own focus effect.

Don't use a shadow for

  • Grouping content on the page. Use a border or a background such as Bg/Weak-50.
  • Showing state such as selected or invalid. Use colour and text.
  • Emphasis. A heavier shadow doesn't make an action more important; Button appearance does.

Do and don't

x-small
medium
DoMatch the shadow to the height. A resting field gets x-small; a floating menu gets medium. People read depth from the difference.
large
large
Don'tDon't put large shadows on page content. Cards on large shadows look like they float, so people try to drag or dismiss them.
DoKeep the intent's focus effect. It's the only focus cue the button has; error actions keep the error halo.
Don'tDon't reuse a focus effect as decoration. A halo on a resting element looks focused and confuses keyboard users about where they are.
DoUse overlay-gray behind modals. It's the backdrop the Command menu uses, so every modal dims the page the same way.
Don'tDon't use a solid colour as a backdrop. An opaque backdrop hides where people were; the overlay keeps the page visible behind the dialog.