Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

WebKit 5 min read How-to mediumAdept

The CSS shape() function

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.

Related posts

  • Make creative borders with background-clip border-area

    WebKit mediumAdept

    `background-clip: border-area`, available in Safari Technology Preview and Safari 18.2 beta, clips a background image or gradient to the border region. That lets a single image, linear, conic or repeating gradient fill any border style, width, radius or subset of sides, unlike nine-slice `border-image`. The recipe is a transparent border, a background with `background-origin: border-box` (otherwise the padding-box origin repeats the background under the border), and the new clip value. Multiple background layers let it combine with `background-clip: text`, and feature queries provide progressive-enhancement fallbacks. Pending CSSWG changes will allow `border-area text` in one layer and default the origin to border-box.

  • WebKit Features in Safari 17.2

    WebKit mediumAdept

    Safari 17.2 ships 39 web platform features and 169 fixes, its largest December release. HTML gains exclusive accordions via the `name` attribute on `<details>`. CSS gains relaxed nesting without `&`, the root font units rcap/rex/ric/rch plus `cap`, completed Motion Path support with `rect()`/`xywh()` shapes, `linear()` easing, mixed percentage and length arguments in `round()`/`mod()`/`rem()`, `counter-set`, unprefixed `mask-border`, and the Custom Highlights API. JavaScript and web APIs add import attributes for JSON modules, `Intl.NumberFormat` approximate ranges, Fetch Priority, responsive image preloading, and H264 L1T2 in WebCodecs, with short code examples for many of them.

  • WebKit Features in Safari 18.4

    WebKit mediumAdept

    Safari 18.4 ships 84 new web platform features, 184 resolved issues and 13 deprecations. Highlights include Declarative Web Push for Home Screen web apps on iOS/iPadOS, which delivers notifications without a Service Worker, and the CSS shape() function for responsive clip paths using CSS units. Other additions include ::details-content styling and animation for <details>, sideways writing modes, text-autospace for CJK spacing, view-transition-name: match-element, and alpha/Display P3 support in the color input. Web Inspector gains device viewport presets in Responsive Design Mode, per-app JSContext auto-inspection, and source map ignoreList support.

  • Release Notes for Safari Technology Preview 243

    WebKit mediumAdept

    Safari Technology Preview 243 ships WebKit changes 310600@main through 312007@main for macOS Tahoe and Sequoia. The bulk of the release is CSS layout and selector fixes, covering flexbox, grid, aspect-ratio, anchor positioning, `:has()` invalidation and CJK line breaking. It also adds `contain: style` for quote counters, the `insert` keyword for `text-autospace` and the `shadowrootslotassignment` attribute. Other changes include accessibility fixes for VoiceOver, an O(n²) fix for parsing large `<select>` lists, an ES module loader rewrite for top-level await correctness, and several regular expression fixes.

  • New to the web platform in June

    web.dev easyNovice

    Chrome 149, Chrome 150 and Firefox 152 reached stable in June 2026. The headline change is that `field-sizing` and the `rect()`/`xywh()` shapes in `shape-outside` are now Baseline across all major engines. Chrome also adds CSS `text-fit`, gap decorations for grid and flex, `background-clip: border-area`, Promise-returning scroll methods, the declarative `focusgroup` attribute, and bfcache eligibility for pages with open WebSockets. Firefox adds interim and final response-header timing in Resource Timing and notification action buttons, while the Firefox 153 and Safari 27 betas preview features such as `Error.stackTraceLimit`, `getAllRecords()`, transform-aware anchor positioning and the `:heading` pseudo-class.

The quest for software engineering knowledge.

Look:
Layout: