---
title: "The CSS shape() function"
description: "CSS shape() lets clip-path, offset-path and similar properties define paths using CSS units, keywords, percentages, calc() and variables, so shapes adapt to element size, unlike path(), whose fixed SVG coordinates can't respond."
url: "https://swe.quest/articles/the-css-shape-function-609f89f42453be65"
canonical: "https://webkit.org/blog/16794/the-css-shape-function/"
source: "WebKit"
published: "2025-04-15"
difficulty: "medium"
kind: "How-to"
reading_minutes: 5
tags: ["css","browsers","frontend"]
---

# The CSS shape() function

A post on [WebKit](https://swe.quest/sources/webkit.md), published 2025-04-15, 5 min read, How-to. Original: [https://webkit.org/blog/16794/the-css-shape-function/](https://webkit.org/blog/16794/the-css-shape-function/)

## Summary

CSS shape() lets clip-path, offset-path and similar properties define paths using CSS units, keywords, percentages, calc() and variables, so shapes adapt to element size, unlike path(), whose fixed SVG coordinates can't respond. A worked example converts an SVG arrow path command by command into shape() syntax, makes it stretch horizontally with percentages, then uses container query units (cqh) so the arrow tip keeps its 90-degree angle at any size. shape() also supports relative commands, arcs, and animation between shapes that use the same command list. Available in Safari 18.4.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [CSS](https://swe.quest/tags/css.md) (Web & mobile)
- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)

## Prerequisites

- CSS clip-path ([easy posts on CSS](https://swe.quest/tags/css.md?difficulty=easy))
- SVG path syntax
- CSS calc() and custom properties ([easy posts on CSS](https://swe.quest/tags/css.md?difficulty=easy))

## Keywords

shape(), clip-path, offset-path, container queries, Safari 18.4, WebKit

## Related posts

- [Make creative borders with background-clip border-area](https://swe.quest/articles/make-creative-borders-with-background-clip-border-area-cdba7fcc9b39e6d8.md): WebKit · 2024-11-20 · Medium · 10 min read · CSS, Browsers, Frontend
  \`background-clip: border-area\`, available in Safari Technology Preview and Safari 18.2 beta, clips a background image or gradient to the border region.
- [WebKit Features in Safari 17.2](https://swe.quest/articles/webkit-features-in-safari-17-2-c596929bac2922c9.md): WebKit · 2023-12-11 · Medium · 27 min read · Browsers, CSS, Frontend, JavaScript
  Safari 17.2 ships 39 web platform features and 169 fixes, its largest December release.
- [WebKit Features in Safari 18.4](https://swe.quest/articles/webkit-features-in-safari-18-4-c34aa1377d66e945.md): WebKit · 2025-03-31 · Medium · 38 min read · Browsers, CSS, Frontend, Developer tools
  Safari 18.4 ships 84 new web platform features, 184 resolved issues and 13 deprecations.
- [Release Notes for Safari Technology Preview 243](https://swe.quest/articles/release-notes-for-safari-technology-preview-243-b654215c3d2767b1.md): WebKit · 2026-05-07 · Medium · 18 min read · Browsers, CSS, Accessibility, JavaScript
  Safari Technology Preview 243 ships WebKit changes 310600@main through 312007@main for macOS Tahoe and Sequoia.
- [New to the web platform in June](https://swe.quest/articles/new-to-the-web-platform-in-june-7816d4d94fd092d9.md): web.dev · 2026-06-30 · Easy · 4 min read · Browsers, CSS, Frontend, Accessibility
  Chrome 149, Chrome 150 and Firefox 152 reached stable in June 2026.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
