One light, five levels
A single box-shadow can be tight or wide, not both, so it looks either pasted on or foggy. Real shadows are a tight contact shadow plus a wide, faint one. The scale here doubles each layer’s offset along one angle, blurs it by a multiple of that offset and, from the third layer, pulls it in by half the offset so a wide layer floats rather than glows. Level 3 is level 2 plus one layer, which is what makes the steps read as a scale and lets a hover cross-fade between them cleanly. The cost in bytes is printed beside every export; these are the default scale’s values. In dark mode each level’s surface is lifted by white at Material’s overlay percentage, 4.5 × ln(dp + 1) + 2.
| Level | Layers | box-shadow, bytes | Dark surface lift |
|---|---|---|---|
| 1 | 2 | 62 | 1dp → 5.1% |
| 2 | 3 | 99 | 2dp → 6.9% |
| 3 | 4 | 137 | 4dp → 9.2% |
| 4 | 5 | 176 | 8dp → 11.9% |
| 5 | 6 | 216 | 16dp → 14.7% |
What a shadow does to the edge
WCAG 2.2’s non-text contrast criterion asks for 3:1 between a control and the colours beside it where the boundary is how you find the control — a text field, a checkbox, a toggle. A shadow changes the colour beside the edge, but unevenly: under the bottom it darkens the page, at the top it barely touches it. Below, Tailwind v4’s six shadow sizes measured by this tool’s engine on a 352 × 150 card, as the lowest and highest ratio between the last pixel of the card and the page beside it.
| Utility | White on white | Slate-800 on slate-900 |
|---|---|---|
shadow-xs | 1.01 – 1.08 | 1.22 – 1.23 |
shadow-sm | 1.03 – 1.23 | 1.22 – 1.24 |
shadow-md | 1.01 – 1.31 | 1.22 – 1.25 |
shadow-lg | 1.01 – 1.32 | 1.22 – 1.25 |
shadow-xl | 1.00 – 1.40 | 1.22 – 1.26 |
shadow-2xl | 1.02 – 1.50 | 1.22 – 1.27 |
On white, no size reaches 1.6:1 anywhere. On the dark pair the two fills already differ by 1.22:1 and the shadow adds almost nothing, because there is little left below a dark page to darken. A content card is allowed a soft edge; a control is not, and a 1px ring is the cheapest way to give it one. In Windows’ forced-colours mode box-shadow is removed entirely, so the full rule adds an outline for that mode.
Glass, and the text on it
backdrop-filter blurs whatever sits behind the surface, so the text on glass has a different background on every page and at every scroll position. The tool paints the backdrop, blurs it as the browser does and measures each line at its least readable pixel. A light glass that works over a soft gradient can fail over a busy page, and a tint that passes through the blur may not pass without it — which is what a browser without backdrop-filter, or a reader with Reduce transparency on, sees. The export carries that stronger tint behind an@supports test.
| Browser | backdrop-filter from | prefers-reduced-transparency |
|---|---|---|
| Chrome, Edge | 76 | 118 |
| Firefox | 103 | Behind a preference only |
| Safari, iOS | 9 with -webkit-, unprefixed from 18 | Not supported |
Support figures are from MDN’s browser compatibility data, 1 October 2026. For the colours themselves, the contrast checker finds the nearest passing text colour, and the gradient generator makes backdrops measured the same way.