Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

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…

Read the release notes

data-canvas

Turn any semantic element into an elevated surface: background, 1px edge, radius, shadow, padding and a centred max width. The attribute form of <layout-canvas>.

Overview

data-canvas gives the element it sits on a surface: --color-surface background, a 1px edge, --radius-l corners, --shadow-l, --size-l padding, full width up to a centred min(72rem, 100%). It is the attribute form of <layout-canvas>; both forms share the same rules.

Unlike data-layout, a canvas does not arrange its children. It is a surface, so its modifiers are bare data-* attributes (data-max, data-padding, data-canvas-depth), the same convention as <layout-card>. Combine it with data-layout on the same element when the contents also need a layout.

Values

ValueEffect
(bare) data-canvasDefault surface: radius, shadow, 1px edge, padding.
flushNo radius and no shadow; an edge-to-edge surface.
elevatedLarger radius (--radius-xl) and shadow (--shadow-xl) at 37.5rem and wider.

On <layout-canvas> the variant goes in data-variant instead; data-variant has no effect next to data-canvas.

Modifiers

AttributeValuesDefaultEffect
data-maxnarrow, normal, wide, prosemin(72rem, 100%)Max inline size, still centred: --content-narrow / --content-normal / --content-wide (40 / 60 / 80rem by default) or 65ch.
data-paddingnone, s, m, l, xllPadding on all sides from the --size-* scale.
data-canvas-depth1, 2—One or two stacked "paper" sheets peeking out below the surface. Ignored on flush and below 37.5rem.

The bare names are deliberate: data-max here is not data-layout-max. One-off values go in the --canvas-* custom properties (--canvas-bg, --canvas-radius, --canvas-shadow, --canvas-padding-inline, --canvas-padding-block, --canvas-width), for example style="--canvas-width: 50rem".

data-canvas-depth also has a page-level meaning: on <body> under <html data-backdrop> it adds the same sheets behind the page's <main>.

Behaviour

  • Nesting — a canvas inside a canvas switches --canvas-bg to --color-surface-raised, so the inner surface reads as a layer above the outer one.
  • Edge — on a plain page the 1px edge is a --color-border hairline; under data-backdrop it is transparent because the tinted page already frames the surface.
  • Small screens — below 37.5rem every canvas goes flush: no radius, no shadow, no depth sheets, full width, --size-m inline padding.
  • Backdrop tokens — the --canvas-* tokens are shared with data-backdrop, so <html data-backdrop="flush"> flattens default canvases too (the elevated variant keeps its shadow).

Accessibility

  • data-canvas is purely visual and adds no role. Put it on the element that carries the right meaning (article, section with a heading, aside), not on a generic wrapper.
  • In forced-colours mode backgrounds and shadows are flattened, so the edge is drawn in CanvasText and the surface stays visible.
  • The surface uses theme tokens, so text on it keeps the theme's contrast. If you override --canvas-bg, check the text contrast against the new colour.

Related

↑