Foundations

Shadows & Elevation

Shadows express the degree of elevation between surfaces, indicating higher priority or position. The page covers 16 tokens in four categories: Shadow Bottom, Shadow Top, Designated Level and Component Specific.

Every example is drawn with the var(--shadow-…) from the package, so it follows the package when it changes. See .claude/skills/eco-elevation for the rules.


Overview

Shadows express the degree of elevation between surfaces. So elevation is the distance between any two elements along the z-axis.

Shadow Bottom

Light from above. The shadow falls on the layer below.

Shadow Top

Light from below. The shadow falls on the layer above.

Higher levels are narrower so each shadow stays visible. Every Bottom and Top level adds a 1px contour shadow (0 0 1px, 5% black) to the main shadow.

Terms

Component specific shadows

This is shadows and elevation used exclusively for specific components in the ECO Design System. These are specified in detail within each component.

Designated level

This is intended for essential global components, such as main and left navigation menus, which must operate on a separate layer and should infrequently, if ever, be hindered by other elements.

Bottom shadow elevation

The Bottom shadow elevation variant simulates a light source from the top direction to cast a shadow on surfaces beneath the component or surface it is connected with. This is the most commonly used set of elevations throughout the UI.

Surface

The lowest level visible container on which components, text etc. are placed upon.

Background

The background color of our applications.

Top shadow elevation

The Top shadow elevation variant simulates a light source from the bottom direction to cast a shadow on surfaces beneath the component or surface it is connected with. This is used sparingly.

Choosing elevation

When selecting an appropriate elevation level, it is essential to adhere to certain best practices.

Boost user focus by increasing elevation. Users pay more attention to items that appear closer, so raise the elevation of actions you want the users to prioritize.

Select an elevation that mimics authentic lighting conditions (as much as possible). Both a shadow’s size and amount of softness or diffusion express the degree of distance between two surfaces.

  • A surface with a shadow that is small and sharp indicates a surface’s close proximity to the surface behind it.
  • Larger, softer shadows express more distance and appear to be elevating on a higher level.

Don’t overuse elevation. Excessive use of elevation can detract from the user experience by causing distractions. It is advisable to apply elevation sparingly.

The ECO Design System offers two base variants of shadow & elevation: Bottom and Top.

We also use Designated Level elevations and Component specific sets of shadow and elevation.

Shadow Bottom

The Bottom shadow elevation variant simulates a light source from the top to cast a shadow on top of the surface or surfaces beneath the component it is placed on. This is the most commonly used set of elevations throughout the UI.

ExampleDescriptionToken

Shadow Top

The Top shadow elevation variant simulates a light source from the bottom to cast a shadow on top of the surface or surfaces beneath the component it is placed on. This is used sparingly.

ExampleDescriptionToken

Designated Level

This is intended for essential global components, such as main and left navigation menus, which must operate on a separate layer and should rarely, if ever, be hindered by other elements.

ExampleDescriptionToken

Component Specific

Shadows used together with a specific component.

ExampleDescriptionToken

Code

Use the token as the whole box-shadow value. The list is generated from tokens.json.

Use in CSS
.card   { box-shadow: var(--shadow-elevation-b-20); }
.modal  { box-shadow: var(--shadow-elevation-b-100); }
.drawer { box-shadow: var(--shadow-elevation-drawer-right); }
All shadow tokens

    

Usage

Do

  • Pick the lowest level that separates the surface. elevation-b-20 is the default for cards.
  • Raise elevation for what you want the user to prioritize, for example modals at elevation-b-100.
  • Use elevation-drawer-* for drawers and navigation.
  • Write the token as var(--shadow-…).

Don’t

  • Overuse elevation. Too many raised surfaces distract.
  • Mix Bottom and Top on one component (exception: the toggle switch).
  • Use elevation-b-* on a drawer.
  • Use a Component Specific shadow outside its own component.