Hover✨ Premium

Shadow Inset

An indigo inner glow swells from inside the element (inset box-shadow 0 → 30 px) over 0.3s on hover — pure CSS, no pseudo-element.

CSSShadow

Updated

This effect is part of Effect.Labs — 840 vanilla effects, some free, some premium. Hover has 48 effects, including 5 free. Explore the category →

3 usage examples

'Join the cooperative' CTA — website for an agricultural cooperative — Shadow Inset example 1

① 'Join the cooperative' CTA — website for an agricultural cooperative

WhenCTA button on a dark background; on hover a soft, wide glow swells from inside without changing the button's shape.
WhyAn inner glow conveys warmth and invitation — more welcoming than a plain background colour change.
Settings260×56 px button on a dark background; glow colour adjusted to a soft green for the agricultural context; zone within the capture ellipse.
Brand ambassador card — community page for a musical instrument maker — Shadow Inset example 2

② Brand ambassador card — community page for a musical instrument maker

WhenMusician ambassador cards; on hover an inner glow lifts the card without shifting or transforming it.
WhyAn inner glow respects the layout (no external box-shadow overflowing onto neighbours) in a tight grid.
Settings280×200 px cards in a 2×3 grid; dark background; musician photo, name and instrument; glow in the instrument's tone (brass → warm orange).
Interactive CV timeline entry — profile builder for independent consultants — Shadow Inset example 3

③ Interactive CV timeline entry — profile builder for independent consultants

WhenEach position in the timeline (400×80 px block) glows inward on hover, signalling that it can be clicked for more information.
WhyAn inner glow on a timeline element is discreet and does not disrupt the chronological reading flow.
Settings400×80 px blocks in a column; dark background; job title and dates; indigo glow on hover.

How it works

The .fx-0351-root wrapper centres a 200 px button. At rest, box-shadow is absent. On hover, box-shadow: rgba(99, 102, 241, 0.5) 0 0 30px inset spreads an indigo glow from the edges inward over 0.3 s. The inner shadow (inset keyword) is drawn inside the element's borders, without overflowing onto neighbours — unlike an outer shadow. Intensity is controlled by the blur radius (30px) and colour opacity (0.5).

No pseudo-element, no added gradient — the only animated property is box-shadow. :focus-visible triggers the same glow with an indigo outline added. Pure CSS. Under reduced motion, the transition is removed but the glow appears instantly on hover and focus — state feedback guaranteed.

Accessibility

  • Reduced motion: under prefers-reduced-motion: reduce, the transition is disabled. The glow appears instantly on hover and focus.
  • Keyboard: the element is a natively focusable <button>. :focus-visible triggers the glow and adds a 2 px outline to signal keyboard focus.
  • Visibility on light backgrounds: the indigo glow may lack contrast on a white or beige background. Adjust the colour and opacity to maintain a visible signal.
  • Touch: a tap activates the CSS hover state on most mobile browsers. The glow stays active until focus moves.

Browser compatibility

Pure CSS. Properties: box-shadow inset, transition, :focus-visible. Verified in Chromium and Firefox: glow visible, two independent copies, 0 errors. box-shadow inset is supported from Chrome 10, Firefox 4, Safari 5.1 — no modern browser limitation.

Chrome 86+✓ Full (measured)
Firefox 85+✓ Full (measured)
Safari 15.4+✓ Full (:focus-visible)
Edge 86+✓ Full (Chromium engine)
Mobile iOS 15.4+✓ Full
Android Chrome 86+✓ Full (measured)

Without :focus-visible (before 2021), keyboard focus does not trigger the glow.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0351-root">
  <button class="isw-box isw-inset" type="button">
    <span>Your text</span>
  </button>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Glow colour (CSS — rgba(99, 102, 241, 0.5)) indigo at 50% Replace the colour with your brand hue. rgba(255, 200, 50, 0.4) gives a warm golden glow.
Blur radius (CSS — 30px in box-shadow) 30 px 10 px gives a glow concentrated at the edges; 60 px fills the centre. Beyond half the element's width, the centre is reached.
Glow opacity (CSS — 0.5 in rgba) 50% 0.2 is very subtle; 0.8 is intense. Adjust to the background: the darker the background, the higher the opacity can be.
Duration (CSS — 0.3s) 0.3 s 0.15 s is snappier; 0.5 s is softer.
Combined outer glow (CSS — add a 2nd box-shadow without inset) inner glow only Add , rgba(99, 102, 241, 0.2) 0 4px 20px to the box-shadow value for a subtle outer glow at the same time — both values separated by a comma animate together.

FAQ

The box-shadow property accepts multiple comma-separated values. Add a second value without inset: box-shadow: rgba(99,102,241,0.5) 0 0 30px inset, rgba(99,102,241,0.2) 0 8px 24px. Both animate together.
Increase the opacity (0.7 or 0.8) and/or the blur radius (40–50px). You can also choose a more saturated or darker colour than indigo to match your palette.
Not directly with box-shadow (colour interpolation is linear between two values). Use a @keyframes on box-shadow with multiple steps, or a CSS animation on hue-rotate via filter applied to the parent element.