SVG✨ Premium

Gradient Mask Fade

A block whose centre stays sharp while its edges dissolve into the page, through a radial mask: grid, image or interface, no animation.

CSSMaskGradient

Updated

This effect is part of Effect.Labs — 840 vanilla effects, some free, some premium. SVG has 30 effects, including 3 free. Explore the category →

3 usage examples

Invoicing software screenshot fading into the product page — Gradient Mask Fade example 1

① Invoicing software screenshot fading into the product page

WhenAn invoicing tool's page: on the left the headline “Your invoices go out before your coffee cools”, the copy and the trial button; on the right the month's invoices screen (totals, five rows with their status) whose edges dissolve into the lavender background.
WhyA screenshot dropped in as is makes a hard rectangle that cuts the page. Faded, it shows the product without a frame, and the eye goes to the centre: the totals and the “Overdue” row.
Settings--gmf-width:100%, --gmf-height:100% in a 312 × 300 px frame, --gmf-fill:#ffffff, --gmf-rx:78%, --gmf-ry:74%, --gmf-solid:48%, --gmf-end:76%; the HTML mock-up of the screen replaces the label.
Blueprint grid behind a home builder's “Our plans” section — Gradient Mask Fade example 2

② Blueprint grid behind a home builder's “Our plans” section

WhenA home builder's models section: a blue blueprint grid fills the whole section and vanishes towards the edges; on top, the “Our plans” heading and three model cards (single storey, two storeys, L-shaped) with floor area and starting price.
WhyThe grid recalls the drawing board without boxing the section in. Because it fades at the edges, it does not clash with the neighbouring sections.
SettingsThe block as section background (position:absolute; inset:0 on the root), --gmf-width:100%, --gmf-height:100%; --gmf-fill = 40 px blue SVG grid, --gmf-rx:70%, --gmf-ry:78%, --gmf-solid:30%, --gmf-end:72%; label removed.
Delivery area sharp in the middle of a map — online greengrocer — Gradient Mask Fade example 3

③ Delivery area sharp in the middle of a map — online greengrocer

WhenA greengrocer's “Delivery” page: a neighbourhood map where the 6 km circle stays sharp around the shop pin while the rest of town pales away; on the right, delivery days, the districts served and a “Your address” field.
WhyThe fade does a legend's job: what is sharp gets delivered, what fades does not. No need to draw an exact boundary, the dotted circle is enough.
Settings--gmf-rx:58%, --gmf-ry:58%, --gmf-solid:42%, --gmf-end:72% on a 270 × 262 px block; an <img alt=""> of the map (drawn in SVG) with the circle and pin in HTML on top, inside the block.

How it works

The .gmf-fade block (280 × 180 px by default) carries a radial-gradient mask-image: an ellipse of 80% × 60% of the box, opaque up to 40% of its radius, then increasingly transparent up to 70%. Where the mask is opaque the content shows; where it is transparent you see what lies behind. The block has no edge: it melts into the page, whatever its colour.

The content is up to you. By default, an indigo grid on a near-black background (a small repeated SVG data URI) with the word “FADE” in the middle. Replace the background with --gmf-fill, or put an <img> in the block: it fills it (object-fit:cover). Any HTML placed inside fades the same way, an interface mock-up included.

The effect is static: no animation, no pointer reaction, no JavaScript. The fade shape is set with four variables (--gmf-rx, --gmf-ry, --gmf-solid, --gmf-end), written once and used by both mask-image and -webkit-mask-image.

Accessibility

  • Nothing moves: no animation or flashing, so the reduced-motion setting has nothing to stop.
  • Real text: the label is a real <span>. Keep important text in the sharp area: on the edges it loses contrast.
  • Images: a screenshot or map placed in the block keeps its alt. If the image only illustrates nearby text, leave alt="".
  • Pointer: the block reacts to nothing and keeps the normal cursor: it does not promise a click.

Browser compatibility

Radial-gradient mask-image, with -webkit-mask-image for Chrome and Edge before 120 and Safari before 15.4; CSS variables inside the gradient. Measured in Chromium, Firefox and WebKit (Playwright): faded edges (removing the mask changes 1.6% of the demo image), two copies, 390 px, white and dark backgrounds.

Chrome 49+✓ Full (measured)
Firefox 53+✓ Full (measured)
Safari 9.1+✓ Full (measured in WebKit)
Edge 79+✓ Full (Chromium engine)
Safari iOS 9.3+✓ WebKit engine, not verified on a real device
Chrome Android 49+✓ Full (Chromium engine)

Without masking the block shows whole, with sharp edges: nothing disappears.

The code

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

index.html — structure
<div class="fx-0624-root">
  <div class="gmf-fade">
    <span class="gmf-label">FADE</span>
  </div>
</div>

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

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Size (CSS — --gmf-width, --gmf-height) 280px / 180px 100% to follow a parent that has a height, for instance as a section background.
Content (CSS — --gmf-fill) indigo grid on #111 Any background value. Or an <img> inside the block, which covers it.
Ellipse width and height (CSS — --gmf-rx, --gmf-ry) 80% / 60% Radii of the fade area, as a percentage of the box. Equal values on a square block give a circle.
Sharp area (CSS — --gmf-solid) 40% How far from the centre the content stays fully visible.
End of fade (CSS — --gmf-end) 70% Where everything is transparent. The wider the gap with --gmf-solid, the softer the fade.
Block background and height (CSS — --gmf-page, --gmf-min-h) #0a0a0f / 300px transparent and 0px: the block then melts straight into your page.

FAQ

No, it is a fixed fade: it does not move or react to the pointer. If you want it to breathe, animate --gmf-solid or --gmf-end in your own CSS; declare those variables with @property (type <percentage>) so they interpolate.
Replace the <span class="gmf-label"> with <img src="screenshot.png" alt="…">: it covers the block. Set --gmf-width and --gmf-height to the image's proportions, and tighten --gmf-solid if only one area of the screen should stay sharp.
Yes: the mask mixes no colour, it makes the edges transparent. You see the page's real colour behind it, light or dark, plain or an image, without copying it into the effect.