Introduction: The Pain of Shaped Elements
Creating complex shapes in CSS has always been a struggle. The classic clip-path property lets you cut elements into polygons, circles, or custom paths, but it comes with a major drawback: you can't add borders or shadows that follow the shape. The moment you apply clip-path, any border or box-shadow gets clipped away, leaving you with flat, lifeless shapes.
But what if you could shape an element and keep its decorations? That's exactly what the new CSS border-shape property promises. It's a fresh approach that shapes the element itself, not just clips it, allowing borders, outlines, and shadows to follow the shape perfectly. In this article, we'll dive deep into border-shape, explore its syntax, and show you how it can transform your CSS workflow.

What is border-shape?
The border-shape property is part of a new CSS module that aims to make shape creation more intuitive. It accepts the same values as clip-path, including the new shape() function, but instead of clipping the element, it shapes it. This means decorative properties like border, box-shadow, and outline are applied to the shape, not the rectangular box.
Basic Syntax
.shape {
border: 8px solid red;
border-shape: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
Two-Value Syntax for Cutout Effects
border-shape also supports two shapes, allowing you to create cutout or border-only effects:
.cutout {
border: 8px solid red;
border-shape: inset(0) circle(50%);
}
In this case, the border is drawn between the outer shape (inset(0)) and the inner shape (circle()). The result is a shape with a hole in the middle, perfect for badges or creative frames.
Why Not Just Use clip-path?
While clip-path is great for masking, it fails when you need borders or shadows. With border-shape, you get the best of both worlds. Plus, if you're already familiar with clip-path, the learning curve is minimal – just swap the property name and adjust your code.
Real-World Applications
- Border-only shapes: Create outlined shapes for icons, buttons, or decorative elements.
- Cutout shapes: Add a transparent hole to a shape, useful for progress rings or overlays.
- Breakout decorations: Extend backgrounds or borders beyond the element's boundary, a common design pattern for full-width sections.
- Animated shapes: Animate the shape values or border width to create engaging hover effects.
![]()
Limitations and Considerations
While border-shape is powerful, it's important to note its current limitations:
- Browser support: As of writing, it's only available in Chromium-based browsers (Chrome, Edge). Firefox and Safari support is pending.
- Content behavior: The content inside the element still follows the original rectangle shape. You might need to use
overflow: hiddenor adjust padding to avoid overlap. - Complexity: For very complex shapes, the
shape()function can be verbose. However, tools like online generators can help.
Advanced Tips
- Combine with
shape(): Theshape()function allows you to create any SVG-like shape. Mastering it will unlock the full potential ofborder-shape. - Use generators: Many CSS shape generators now support
border-shapeoutput, saving you time. - Experiment with animations: Animating
border-shapevalues can lead to stunning effects, like the bouncing blob hover effect shown in the original article.

Conclusion: The Future of CSS Shapes
border-shape is a game-changer for web designers. It solves the long-standing problem of adding borders to shapes and opens up a world of creative possibilities. While still in its early days, it's worth exploring and experimenting with to stay ahead of the curve.
Next Steps:
- Try converting your existing
clip-pathshapes toborder-shapeand see how they behave. - Experiment with the two-value syntax to create cutout effects.
- Bookmark the CSS Shapes collection for inspiration.
If you're interested in the broader CSS landscape, check out our article on CSS functions that work without arguments for more insights.