What is the difference between clip-path and mask?▾
clip-path defines a shape region and discards everything outside it, using geometric primitives or SVG paths. mask uses a separate image or gradient as an alpha or luminance channel to control visibility. clip-path is simpler and GPU-friendly; mask allows smooth gradual edges and bitmap-defined shapes.
Can I animate clip-path between two polygon shapes?▾
Yes, as long as both polygon shapes have the same number of vertices. CSS interpolates each vertex position separately. If vertex counts differ, the transition jumps rather than interpolates. Always match vertex counts when designing from/to animation pairs.
Why does my polygon need the same number of points to animate?▾
The browser animates clip-path by linearly interpolating each x/y coordinate pair. Without a 1-to-1 mapping of vertices, it has no way to decide which destination point each source point should travel toward, so it cannot interpolate and falls back to a hard swap.
How do I make a star shape with clip-path?▾
A five-pointed star needs ten polygon points alternating between outer radius and inner radius positions. The generator includes a star preset that sets up all ten vertices. Adjust the inner-to-outer radius ratio to control how sharp or stubby the star points appear.
Does clip-path affect click events outside the shape?▾
Pointer events still fire within the original bounding box by default, not just the visible clipped area. To restrict clicks to the visible shape, add pointer-events: none to the parent and pointer-events: auto to the clipped child, or use JavaScript hit-testing.
Can I use SVG paths inside clip-path?▾
Yes. clip-path: path() accepts an SVG path string for complex curves, spirals, and text cutouts that polygon cannot express. Browser support for path() syntax is good in modern browsers but lacks the percentage-based responsive scaling of the shape functions.
How is clip-path different from border-radius?▾
border-radius only rounds rectangle corners with circular or elliptical arcs. clip-path can produce any polygon, diagonal cut, circle, ellipse, or SVG path. For anything more complex than rounded rectangles, clip-path is the right tool.
Why are some browsers showing the unclipped shape?▾
Very old browsers lack clip-path support entirely, while some intermediate versions require the -webkit-clip-path prefix. Ensure you include both webkit-prefixed and unprefixed declarations. Modern Chrome, Firefox, Safari, and Edge all support clip-path without prefixes.