0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
Punch a circle, diamond, arch window or hexagon hole through an element, or bite its top corner, with an evenodd CSS shape().
Overview
data-cutout punches a hole through an element so whatever is behind it shows through. It draws two paths in one clip-path: shape(), the outer rectangle and the inner shape, with the evenodd fill rule, so the inner shape is removed. Use it on decorative surfaces: gradient tiles, cards over a photo, hero panels.
The hole removes everything the element paints there, its own text and children included. Keep content out of the middle of the element (or out of the corner, for badge-corner).
Usage
A gradient tile with a circular hole, label in the caption
Centred circle, 60% across. A true circle on a square element; an ellipse otherwise, because the radius is a percentage of each axis.
diamond
Centred diamond
arch-window
Arched window opening, open to the lower part of the element
hex
Centred hexagon
badge-corner
A concave quarter-circle bite out of the top inline-end corner (top right; top left in right-to-left pages). Room for a badge or avatar that overlaps the corner.
The centred holes are symmetric; only badge-corner mirrors under :dir(rtl). The element gets position: relative so you can place an overlapping badge in the bite.
Styling
There are no custom properties. Give the element a background (the hole is invisible on a transparent element) and a size; aspect-ratio: 1 keeps circle round.
Do not combine it with another clip on the same element (data-shape-start, data-border-shape): only one clip-path applies. data-morph is skipped on a cutout element for the same reason.
Accessibility
The hole hides content without hiding it from screen readers: text under the hole is still read aloud but cannot be seen. Never put text, links or controls where the hole is.
The outer edge of the clip runs past the element's box, so the element's own focus ring, outline and shadow stay visible when it is focusable.
In forced colours mode and in print the clip is removed. Backgrounds are flattened there, so the hole would only hide content.
Examples
All five cutouts on gradient tiles, with the labels in the captions.
Corner bite
<articleclass="tile"data-cutout="badge-corner"><h3>New arrivals</h3><p>Text stays in the lower-left of the card, away from the bite.</p></article>