The Offset Shadow, Explained Properly
The hard offset shadow is one box-shadow with no blur at all.
The four lines
We tried this on a client site first, because a real deadline is the only honest test. It held up better than we expected, and the handover notes were half as long as usual.
- A zero blur radius
- An offset of 4 to 12 pixels
- Solid black, never a grey
The trick is to decide once and write it down. Most messy stylesheets are not badly written; they are a record of the same decision being made twenty different ways.
If it has blur, it is a different style. Keep the edge sharp.
Nothing here needs a framework. A few lines of plain CSS and a template that prints clean markup will get you most of the way.
We checked every page at 390 pixels wide before calling it done. Phones are where layouts break first, and where most of our readers are.
It is tempting to add one more variation. Resist it. Every option you add is one more thing to test, document and eventually delete.
Our rule of thumb: if we cannot explain a choice in one sentence to a client, we probably should not ship it.
12 thoughts on “The Offset Shadow, Explained Properly”
The quote near the top is going on a sticky note.
It holds up, as long as the gap stays consistent.
This is exactly the kind of post that keeps me reading this blog.
It holds up, as long as the gap stays consistent.
Fair point, we should have mentioned it.
This changed how I think about borders.
Same here. It took a week to get used to it.
Ha, we had the exact same argument.
Seconded. More posts like this.
I disagree on the shadows, but the rest is spot on.
Bookmarked. This is going straight into our starter theme.
Our designers pushed back at first, but the results convinced them.