v149 · CSS · Text Wrapping
Support path() and shape() in shape-outside
Chrome 149 extends shape-outside to accept the path() and shape() CSS functions — the same functions used for clip paths and polygon shapes — making arbitrary text wrapping paths expressible in pure CSS without inline SVG.
concepts
-
path() Wrapping Demo
Float an element with a
shape-outside: path(…)value and watch text flow around a custom SVG path — curves, arcs, and compound shapes that were previously only possible with an inline<svg>element andclip-path. -
shape() Function Demo
Use the newer
shape()CSS function syntax (relative commands, responsive units) to define text-wrapping contours. Comparepath()'s absolute SVG syntax withshape()'s CSS-native relative coordinates. -
Magazine Layout
Editorial text wrapping around five shape presets — circle, arch, star, wave, diamond — using
shape-outside: path(…)andpolygon()on a floated element. Live CSS output pane shows the exact declaration for each shape. -
Path Shape Builder
Pick from five preset paths, adjust float size, side, and shape-margin, and watch text wrap in real time. Copy the generated CSS to use in your own project. Each preset also applies
clip-pathusing the same path so the float's visible shape matches its wrap contour. -
Combined Float + Clip
Three-column comparison: old square-float-with-SVG-child approach, clip-path alone (float looks right but text wraps the box), and clip-path + shape-outside with the same path (text hugs the shape). Choose from four preset paths and see the difference immediately.
-
Animated Wrap Path
CSS
transitioncan interpolateshape-outside: path()values — when paths share the same command sequence, the browser morphs the wrap contour smoothly and text reflows in real time. Five shapes (hexagon, droplet, star, wave, arrow) transition with anease-in-outcurve;clip-pathtransitions in sync so the visible shape always matches the text-wrap boundary. Hit Auto-cycle to step through all shapes automatically.
why it shipped
shape-outside has always accepted polygon(), circle(), ellipse(), and inset() as its shape values, but these primitives could not express the kinds of curves that designers routinely use — a scalloped edge, a brand logo contour, or a wave. The workaround was to embed an SVG element, apply clip-path to it, and use that element as the float — a multi-element, cross-language hack. Chrome 149 closes the gap: path() accepts the exact same SVG path string syntax already used in d, clip-path: path(), and offset-path; while shape() provides a responsive CSS-native variant with support for percentage units and relative move commands. Text wrapping is now a one-property CSS declaration.
syntax
/* path() — SVG path string, absolute coordinates */
.float-left {
float: left;
width: 200px;
height: 200px;
shape-outside: path('M 0 0 C 50 0, 200 100, 200 200 L 0 200 Z');
}
/* shape() — CSS-native, supports percentages and relative commands */
.float-right {
float: right;
width: 200px;
height: 200px;
shape-outside: shape(from 0% 0%, curve to 100% 50% with 50% 0%, line to 0% 100%);
}
references
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗