Shadowed 0.4.0: Box shadows for Typst

shadowed 0.4.0

I just released a new version of shadowed, the library that brings box shadows to Typst!

What is shadowed?

shadowed brings beautiful, customizable box shadows to Typst. Wrap your content
with the shadow() function and it automatically places a shadow behind it, no
manual place.

What’s new in 0.4.0

  • Inner shadows: set inset: true to draw the shadow inside the box, so a
    surface reads as recessed instead of raised.

  • A spread for every side: spread now takes a dictionary, so each edge can grow or contract on its own.

  • Shadows that stack: inner and outer shadows compose cleanly, so you can layer several shadow() calls into one believable result.

  • Dual licensed under MIT OR Apache-2.0.

Inner shadows

Passing inset: true draws the shadow on the inside edge of the box. It is painted on top of your content, so the box looks carved into the page.

A spread for every side

spread used to be a single length. It still is, but now it also accepts a dictionary, so every edge can be controlled independently:

key effect
top, right, bottom, left spread of that one side
x shorthand for left and right
y shorthand for top and bottom
rest fallback for every side not named explicitly

Negative values contract the shadow on that side. This works for inner shadows too, the same dictionary just shrinks the inner opening instead.

Stacking shadows

Every shadow() call wraps its content, so nesting them stacks their shadows.

Two recipes:

  • Colored stack: several outer shadows in different colours, each offset a different way, blend into a soft multi-colour halo.
  • Glossy key: an outer glow plus an inset highlight on the same box give it a glossy, raised face.

Upgrading from 0.3.0

Nothing to change: blur, spread, dx/dy, fill and radius all behave as before. 0.4.0 only adds: inset: true, dictionary spread, and the license change to MIT OR Apache-2.0.

Learn More

3 Likes