Pinatool

CSS Mask Generator

Create responsive CSS masks with linear, radial, vignette, and conic alpha gradients. Test on custom photos or gradient cards, customize stops and origins, then copy production-ready CSS.

Live Mask Preview

Transparency reveals the underlying background stage

Graphic:
Alpha Mask Demo

Pinatool Design

Smooth linear, radial, vignette, and conic alpha gradients.

linear-gradient(180deg, black 25%, transparent 85%)

Mask Presets
Ready to customize CSS mask.

Ready to customize CSS mask.

Export Ready CSS

Standard + WebKit properties for broad browser compatibility

.masked-element {
  -webkit-mask-image: linear-gradient(180deg, black 25%, transparent 85%);
  mask-image: linear-gradient(180deg, black 25%, transparent 85%);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

Mask Settings

Mode
Alpha Stops
Geometry & Repeat

How It Works

1

Choose Mask Gradient Mode

Select Linear for edge fades, Radial for circular spotlights, Vignette for photo framing, or Conic for rotational sweeps.

2

Fine-Tune Stops & Center Origin

Adjust angle, center X/Y position, and opaque/transparent stops. Toggle inversion to flip reveals into cutouts.

3

Copy Browser-Ready CSS

Copy clean CSS with vendor-prefixed properties for Safari, or download a standalone stylesheet ready for your website.

CSS Mask Generator Key Features

Four Gradient Modes

Linear fades, circular spotlights, elliptical vignettes, and 360-degree conic sweeps give you complete creative control.

WebKit Compatibility Built In

Emits standard mask-image alongside -webkit-mask-image so your gradients render smoothly across Chrome, Firefox, Safari, and iOS.

Standard & -webkit-mask-image with Image Preview

Generates dual standard and WebKit CSS properties for broad cross-browser compatibility while letting you test fades live on custom photos or sample cards.

Frequently Asked Questions

How do CSS alpha masks work?

A CSS mask uses opacity (alpha) to control the visibility of an element. Opaque areas of the mask reveal the underlying element, while transparent areas hide it. Unlike hard clip-path shapes, gradient masks create soft, continuous fades and feathered edges.

Why does the generated code include -webkit-mask declarations?

While standard mask-image is broadly supported in modern browsers, Safari and older WebKit-based browsers still require or perform more reliably with vendor-prefixed -webkit-mask properties. We emit both standard and prefixed declarations together for broad cross-browser compatibility.

What is the difference between CSS clip-path and CSS mask-image?

CSS clip-path creates a binary geometric boundary (either fully inside or fully outside the polygon or shape). CSS mask-image supports partial transparency, enabling soft gradient fades, feathered vignettes, blurred spotlights, and repeating alpha textures.

What does the Invert option do?

Invert swaps the transparent and opaque color stops of the gradient. For example, a radial spotlight that normally reveals the center and hides the edges will instead create a center cutout hole with visible outer edges when inverted.

How do mask-size and mask-repeat work with gradient masks?

Adjusting mask-size scales the gradient pattern relative to the element, while enabling mask-repeat tiles it across the surface. Together, they let you build striped reveals, dot grids, and repeating transparency patterns with pure CSS.