Make creative borders with background-clip border-area
`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.
Related posts
- WebKit Features in Safari 18.2
WebKit mediumAdeptSafari 18.2 ships 61 new WebKit features and 111 fixes, headlined by cross-document View Transitions (with view-transition-name: auto, transition classes and types, and pageswap/pagereveal events), CSS text-box trimming for optical alignment to cap height, and background-clip: border-area. It also brings modern calc() with division by units, ruby-align/ruby-overhang and unprefixed ruby-position, scrollbar-width and scrollbar-gutter (which has no effect with overlay scrollbars), ::target-text styling for text fragment links, spatial video and photo viewing in visionOS, WebXR enabledFeatures, Genmoji support, WASM garbage collection and HTTPS by default. Code samples show how to apply each feature, and Safari is the first browser to ship text-box, which degrades gracefully as a progressive enhancement.
- The CSS shape() function
WebKit mediumAdeptCSS 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.
- WebKit Features for Safari 26.2
WebKit mediumAdeptSafari 26.2 ships 62 new web platform features and 165 bug fixes, many of which replace JavaScript workarounds with plain HTML and CSS. New HTML features include button `command`/`commandfor` attributes for controlling dialogs and popovers, `hidden=until-found` and auto-expanding `details` for find-in-page, ARIA index text attributes, and full-width number normalization. CSS additions include `field-sizing`, `random()`, `sibling-index()`/`sibling-count()`, text shaping across inline boxes, Anchor Positioning refinements, `color-mix()` defaulting to Oklab, `scrollbar-color`, accent-color legibility clamping and a full `text-decoration` shorthand. The release also adds the Navigation API, opt-in CHIPS partitioned cookies and WebGPU in WebXR on visionOS.
- WebKit Features in Safari 16.2
WebKit mediumAdeptSafari 16.2 focuses on cross-browser interoperability as part of Interop 2022, with Safari Technology Preview 159 passing 98.5% of the Interop tests. It completes support for `font-variant-alternates` values such as `styleset()`, `swash()` and `ornaments()` along with `@font-feature-values`, and adds `last baseline` alignment for Flexbox and Grid items. A long list of fixes covers CSS layout (flex sizing, scroll snap, text-decoration, aspect-ratio), rendering (transforms, canvas, tables), SharedWorker, and WebDriver on iOS.
- WebKit Features for Safari 27.2
WebKit mediumAdeptSafari 27.2 refines Customizable Select with a new `::field-content` pseudo-element for styling the displayed selected option without `<selectedcontent>`, adjusts `appearance: base-select` UA styles (flex-based button spacing, inherited `text-overflow`, simpler `::picker-icon`), and uses `safe` alignment so large pickers stay within the viewport. Grid Lanes renames `flow-tolerance` to `fit-tolerance` (old name kept as a deprecated alias); the property sets how close column heights must be to count as tied, and raising it well above the 1em default keeps item order steadier for keyboard users. The release also ships 20 bug fixes spanning accessibility, media/WebCodecs, cookies under CNAME, WebGPU indirect draws, and WebRTC.