✂️ CSS Shapes & Typography

CSS Clip-Path, Triangle & Text Shadow Generator

Create geometric CSS clip-path shapes, CSS triangles, and glowing typography text shadows with live interactive visual controls.

1. Clip-Path & Shape Generator
CSS Code
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
2. Text Shadow & Glow Generator
Shadow Offset X2px
Shadow Offset Y2px
Blur Radius4px
#6366f1
Glowing Text
CSS Code
text-shadow: 2px 2px 4px #6366f1;

How clip-path coordinates are measured

clip-path hides every part of an element that falls outside a shape you describe. The element keeps its full rectangular box in the layout; only the painted area is cut down. Percentages in the shape are measured against the element's own box, with 0% 0% at the top-left corner and 100% 100% at the bottom-right.

Because the coordinates are relative, the same rule produces different shapes on boxes with different proportions. The triangle polygon(50% 0%, 0% 100%, 100% 100%) is an equilateral-looking triangle on a square but a squat, wide one on a banner. If you need the shape to keep its proportions, set an aspect-ratio on the element as well.

Worked examples with the four presets

Hexagon: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%) on a 200px by 100px element puts the six corners at (50, 0), (150, 0), (200, 50), (150, 100), (50, 100) and (0, 50) in pixels. That is a stretched hexagon. A flat-topped regular hexagon has a width to height ratio of 2 to the square root of 3, so the same polygon becomes regular on a 200px wide element that is about 173.2px tall (aspect-ratio: 2 / 1.732).

Inset: inset(10% 20% 10% 20% round 10px) on a 300px by 200px element trims 20px from the top and bottom (10% of the height) and 60px from each side (20% of the width). The visible area is 180px by 160px with 10px rounded corners.

Circle: circle(50% at 50% 50%) does not simply use half the width. A percentage radius is resolved against the box diagonal divided by the square root of 2. On a 300px by 200px box that gives a radius of roughly 127.5px, a diameter of about 255px, which is taller than the box, so the circle is cut flat at the top and bottom. Use it on square elements for a clean circle.

Clip-path versus older shape techniques

Before clip-path was widely supported, CSS triangles were made with the border trick: a zero-size element with one coloured border and transparent neighbours. That still works, but it cannot hold text or images and is awkward to size. A clipped element can contain anything, from a photo to a gradient, and the shape scales with the element.

For simple round avatars, border-radius: 50% plus overflow: hidden is still the lighter choice. Reach for clip-path when you need angles: diagonal section dividers, hexagonal badges, arrow-shaped breadcrumb steps or shapes that animate between states.

  • Clipping also cuts off box-shadow and outline, because they are drawn outside the shape. Put the shadow on a wrapper using filter: drop-shadow(), which follows the clipped outline.
  • Pointer events only register inside the visible shape, so a clipped button is not clickable in its hidden corners.
  • Two polygon() values can be transitioned smoothly only if they have the same number of points.

Getting text-shadow to read well

text-shadow takes an X offset, a Y offset, a blur radius and a colour. Unlike box-shadow there is no spread value, so a stronger glow comes from stacking several shadows separated by commas, for example 0 0 4px #6366f1, 0 0 12px #6366f1. The first shadow in the list is painted on top.

A zero offset with a blur gives a halo; a small offset with no blur gives a hard, retro drop. Shadows do not count toward text contrast, so check the text colour against its background on its own. Heavy glows on body text reduce legibility; keep them for large headings.

Clip-Path & Shape Studio: frequently asked questions

Does clip-path affect the space an element takes up?

No. The element keeps its full rectangular box, so surrounding content is laid out as if nothing was clipped. If you need text to flow around the shape, use shape-outside on a floated element alongside the clip-path.

Why did my box-shadow disappear after adding clip-path?

The shadow is drawn outside the element's border box, and clip-path hides everything outside the shape. Wrap the element in a container and apply filter: drop-shadow() to the container, which follows the visible outline of the clipped child.

Can I animate between two clip-path shapes?

Yes, if both values use the same shape function and, for polygon(), the same number of points. The browser then interpolates each coordinate pair. Mismatched point counts snap from one shape to the other without a transition.

Is clip-path supported in all modern browsers?

The basic shapes used here, polygon(), circle() and inset(), work in current versions of Chrome, Edge, Firefox and Safari without a prefix. Very old Safari versions needed -webkit-clip-path, so add it only if you must support them.

How do I make a neon text effect with text-shadow?

Set a bright text colour and stack two or three shadows with zero offset and increasing blur, using the same or a slightly darker colour. Neon effects read best on a dark background and at large font sizes.

All css & visual generators