Skip to content

Shadows

Reusable box-shadow presets for consistent elevation across your site.

The Shadow panel in Global Settings manages a library of box-shadow presets. Each preset becomes a CSS variable (for example --styble-shadow-light-2dp) that blocks — including Buttons — can apply, so elevation stays consistent everywhere.

Shadow panel

Built-in presets

Styble ships with 6 shadow presets, named on a Material-style dp (elevation) scale:

PresetSlugOffset (x / y)BlurSpreadColor
Subtle (1dp)subtle-1dp0 / 120rgba(0,0,0,0.12)
Light (2dp)light-2dp0 / 240rgba(0,0,0,0.14)
Medium (4dp)medium-4dp0 / 460rgba(0,0,0,0.16)
Strong (8dp)strong-8dp0 / 8180rgba(0,0,0,0.18)
Deep (12dp)deep-12dp0 / 12170rgba(0,0,0,0.20)
Sharp (4dp)sharp-4dp4 / 400rgba(0,0,0,0.25)

All built-in presets use the Outset shadow type by default.

Editing a preset

Click a preset to open its editor. The available controls are:

ControlOptions
TypeOutset or Inset.
X-offsetHorizontal offset (px).
Y-offsetVertical offset (px).
BlurBlur radius (px).
SpreadSpread radius (px).
Shadow ColorThe shadow color (defaults to #333333 for new pickers).

A live preview box shows the current shadow as you edit.

Custom shadows

Use the Custom add control at the bottom of the panel to create your own shadows. A new shadow starts as a copy of the first preset, gets an editable Name and a unique slug, and exposes the same controls. Custom shadows can be deleted; built-in presets cannot.

Apply shadows in blocks

Because each preset is a CSS variable, you can select it from box-shadow controls in blocks and in the Buttons panel instead of re-entering shadow values by hand.

Tips

  • Use a small, consistent set of elevations (for example Subtle for cards, Light for buttons, Strong for popovers) rather than many one-off shadows.
  • Editing a preset updates everywhere it's referenced, so adjust the global preset rather than overriding shadows per block.
  • See the Global Settings overview for how all panels fit together.

Released under the GPL-2.0-or-later License.