Faragiri
English

Choose a language 2

Learn Depth and shadow Visual design

A Wroclaw stock ordering tablet where every card carried the same shadow, and a real overlay read as a thirteenth card for four months.

6Sections
5Min read
4Depth

Recommended Before This

0 / 2

Elevation means how close to the reader, which is how much it may interrupt. That is the only thing it is allowed to mean, and every misuse of a shadow comes from making it mean something else.

Kasia is setting the elevation model for a supermarket's stock ordering app in Wroclaw. It runs on a tablet in a stockroom, in light mode under fluorescent tubes and in dark mode on the night shift.

Four levels and what each may do

Four levels: base, raised, overlay and modal, and a fifth means two things compete. Base is the page. Raised is a card that sits on it and does not interrupt. Overlay is a menu or a popover that covers content and closes when you look away. Modal takes the whole screen's attention and has to be dismissed.

One model, two modes

Four levels and the four numbers that define each one

Offset and blur roughly double at each step, making the four levels read as one physical order rather than arbitrary shadows.

y offset (px), blur (px), shadow opacity (%), and dark mode lightness

ybluropacitydark L
Base00018
Raised241224
Overlay8161628
Modal16322432

Elevation means proximity and interruption only; assigning a fifth level or tying it to importance breaks the whole model.

Modular Type Scale & CSS Flex/Grid Motion Lab

Test harmonic typography ratios and live Flexbox/Grid layouts with 1-click CSS export.

The specs are four numbers each. Raised is 2 px down, 4 px blur, 12 opacity, and lightness 24 in dark. Overlay is 8 and 16 at 16, and modal is 16 and 32 at 24. Each step roughly doubles the offset and the blur, which is what makes the four read as an order rather than as four shadows.

Elevation is not importance, and a brand colour is not an elevation. A card is not raised because the merchandising team cares about it, and a coloured panel is not above anything. Both of those decisions are made constantly and both put the model beyond repair, because once elevation means two things it means neither.

How the shadow is built

Two shadows: a tight contact edge and a soft ambient cast. The first is a small offset with almost no blur, sitting right under the object, and it is what makes something look like it is resting on a surface. The second is wider and much softer, and it is the light in the room. One shadow doing both jobs reads as a glow.

Shadow anatomy

Two tinted shadow layers plus a resilient 1 px border

A realistic surface shadow pairs a sharp contact edge with a soft ambient cast and keeps a border when shadows disappear.

  1. 1 px fallback borderkeeps surfaces distinct in forced colours, print, and pasted screenshotsfallback
  2. Tight contact edgesmall offset with minimal blur anchoring the card onto its surfacecontact
  3. Soft ambient castwider surface-tinted layer representing room light, never pure blackambient

Using one large soft shadow reads as a glow, and pure black on warm grey reads as dirt.

The shadow takes the surface's hue, never pure black. A black shadow on a warm grey panel reads as dirt, because a real shadow is the surface with less light on it and not a smear of neutral. Take the surface's hue, drop the lightness, and set the opacity.

And a 1 px border is the fallback where a shadow does not render. In a forced colours mode, in print, and in a screenshot pasted into a document, every shadow on this page disappears, and a card with no border becomes indistinguishable from the page it sits on.

The other half of the model

In dark mode the shadow does nothing and the lightness step does it all. A shadow is dark on dark, so the entire separation comes from the surface getting lighter as it rises, which is why the fourth number in each row exists and is the one people leave out.

The other half

Surface steps in dark mode and restraint on card lists

When shadows vanish on dark grounds, lightness carries the hierarchy while hover states stay flat.

Keep elevation signals unambiguous

  1. YesUse lighter surface steps in dark modedark shadows do nothing on dark surfaces, so lightness shows heightYes
  2. YesUse border or background changes on card hovershows pointer focus without altering physical depthYes
  3. NoLift whole cards on hover in a list of twelvecreates a rippling texture under the cursor instead of a useful signalNo

Leaving out the dark lightness value leaves half the elevation model missing.

Never lift a whole card on hover in a list of twelve. Twelve cards that can rise is a surface that ripples under the pointer, and the effect is a texture rather than a signal. If a card needs a hover state it gets a border or a background change, and the elevation stays where it was.

What to open

CSS box-shadow takes a comma separated list, part of the language and free, so the two layer shadow is one declaration. It replaced a single large soft shadow, which is what a design tool produces by default and which reads as a glow at any size.

What to open

One CSS property to layer shadows and one OS mode to break them

Built-in browser syntax writes both layers cleanly while forced-colours mode proves whether cards survive without shadows.

  • Comma-separated box-shadow
  • OS forced-colours mode
  • Comma-separated box-shadowcombines contact and ambient shadows in one CSS declaration
  • OS forced-colours modestrips every shadow at once to reveal missing surface borders in ten seconds

Testing without shadows catches cards that merge invisibly into the page background.

The operating system's forced colours mode is the test, free and already installed, and it removes every shadow on the screen at once. It replaces assuming a shadow will always render, and it takes about ten seconds to find every place where the shadow was the only thing separating two surfaces.

Where it stalls: a shadow is cheap importance

A shadow is the cheapest way to make something look important, and importance is not what a shadow says. It costs one line, it requires no layout change, it makes a flat screen look designed, and it is available to anybody at any moment.

Where it stalls

How one-line emphasis turns into eleven competing shadows

Because a shadow costs no layout work, teams reach for it to signal brand or priority until nothing reads as raised.

Shadow inflation

  • 01Need quick visual emphasis
  • 02Raise cards for brand polish
  • 03Eleven elements float at once
  • 04Count distinct shadows in built CSS
  1. 01Need quick visual emphasisone line feels faster than fixing layout
  2. 02Raise cards for brand polisheach individual addition looks harmless
  3. 03Eleven elements float at oncewith everything raised, nothing stands out
  4. 04Count distinct shadows in built CSSaudit outputs against the four approved levels

Counting distinct shadow declarations in the compiled stylesheet settles the argument without debate.

So it gets applied for emphasis, for hierarchy, for brand, for making a card feel premium, and each application is small and defensible. What accumulates is a screen on which eleven things are raised, which means nothing is, and the model still exists in the documentation.

The check is a count rather than an argument: how many distinct shadow values are in the built stylesheet, and how many of them are on the list of four. Anything else came from an afternoon.

What it looks like when it goes wrong

The ordering app put the raised shadow on every card in the stock list to make it feel less flat. Twelve shadows on a screen at once, all at the same level, so nothing was above anything. When a genuine overlay appeared, the quantity picker that covers the row underneath, it did not read as covering anything: it looked like a thirteenth card. Staff tapped through it onto the row behind, which the tablet interpreted as a second selection, and the ordering errors that followed were investigated as a training problem for four months.

When it goes wrong

How twelve raised cards disguised a quantity overlay

Putting a raised shadow on every stock row erased the boundary between resting cards and an active picker.

  1. 01Twelve cards share raised shadowapplied across the stock list to look less flat
  2. 02Quantity picker openstrue overlay looks like a thirteenth card
  3. 03Staff tap through onto row behindtablet records an unintended second selection
  4. 04Four months of order errorsinvestigated as staff training instead of elevation

When resting cards mimic overlays, users cannot tell which layer captures their tap.

The fourth number in every row is a lightness rather than a shadow, and where those come from is semantic colour, states and dark mode. The two upper levels exist to interrupt, and deciding when that is justified is when to interrupt, and when not to. And a shadow is a tonal difference before it is anything else, which puts it under the same arithmetic as why one small dark shape balances a large pale one. What else the surface is made of is one level up, in making an interface look considered.

Alongside this

Above this