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…
Make any element a CSS size-query container (container-type: inline-size), optionally named card, panel or media, and keep sectioning children of content-sized layouts as containers on purpose.
Overview
data-container sets container-type: inline-size on the element, so @container queries and cqi units inside it measure the element instead of the viewport. A value names the container, so component CSS can target it with @container card (…) rather than the nearest anonymous container.
It has two jobs:
Opt in — make a non-sectioning element (a li, a figure, a custom element) a query container.
Escape hatch — keep a main, article, section or aside a container inside the layouts where VB otherwise switches containment off.
Values
Value
CSS
Query with
(bare) data-container
container-type: inline-size
@container (width < …) (anonymous)
card
+ container-name: card
@container card (…)
panel
+ container-name: panel
@container panel (…)
media
+ container-name: media
@container media (…)
VB itself ships no rules that query card, panel or media; the names are for your component CSS. For any other name, set container-name in your own CSS alongside the bare attribute.
A named container
12345678
<articledata-container="card"><h3>Downloads</h3><ul><li><strong>128</strong> today</li><li><strong>904</strong> this week</li><li><strong>3,410</strong> this month</li></ul></article>
VB already makes every main, article, section and aside (except floated aside.float / aside.sidenote) an inline-size container, so on those elements the bare attribute is only needed as an escape hatch. Size containment ignores the element's content when working out its width, so a container that is sized by its content collapses to zero width. VB therefore removes containment from sectioning elements that are direct children of:
<layout-cover> / data-layout="cover" with data-layout-centered
<layout-stack> / data-layout="stack" with data-layout-alignstart, center or end
<layout-grid> / data-layout="grid" with data-layout-subgrid, for a different reason: a query container is laid out independently and cannot be a subgrid, so its rows would not line up with its siblings'
Adding data-container to such a child excludes it from that reset, so it stays a container. In the flex layouts, give it a width (an explicit inline-size, a flex-basis, or a --layout-* one-off), or it collapses; in a subgrid, it keeps its width but sizes its own rows.
The same escape hatch applies to text layouts: a <layout-text>, data-layout="prose", layout-columns or article[data-measure] host stops being a container while it holds a data-bleed child (so the child can measure the outer container). data-container on the host keeps it a container.
Keep one cluster child a container
12345
<sectiondata-layout="cluster"data-layout-gap="s"><article>Content-sized, not a container</article><!-- Opt back in; it needs a width --><articledata-containerclass="stat-card">Container</article></section>
Related container names
Page and main-level layouts name their regions for you; you do not need data-container on them. See data-page-layout (region-main, region-nav, region-aside) and Grid Identity (region-main-*).
Accessibility
data-container changes only how size is measured; it adds no role and no semantics.
Container queries respond to the space a component actually has, which also covers zoom and large text: at 200% zoom or with a larger root font size, containers measured in rem narrow and components switch to their compact form instead of overflowing (WCAG 1.4.10 Reflow).
When a query reorders content visually (for example with order or grid placement), keep the DOM order meaningful so keyboard and screen-reader order still match.