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…
Region-wide density variant. Set on <html>, <body> or any container to swap the VB spacing scale (--size-3xs through --size-3xl) for a tighter or looser one, without touching individual layouts. Compact for dashboards and admin UIs, spacious for marketing pages.
Overview
The data-layout-densityattribute is a single switch over VB's spacing scale. Set it on <html>, <body> or any container, and the --size-* tokens inside that subtree are replaced. Layouts and components that read those tokens (data-layout-gap, padding, margins, component spacing) recompute automatically — no per-component changes.
compact — tighter spacing for dashboards, data tables, admin UIs.
spacious — generous spacing for marketing pages, hero-heavy landings.
Each step of the --size-3xs through --size-3xl scale is replaced with a fixed value from the table below. The steps do not all shift by the same factor: compact halves the three smallest steps, takes s to two thirds and the rest to three quarters; spacious doubles the small steps and adds about a third to a half to the large ones.
Token
Default
compact
spacious
--size-3xs
0.125rem
0.0625rem
0.25rem
--size-2xs
0.25rem
0.125rem
0.5rem
--size-xs
0.5rem
0.25rem
0.75rem
--size-s
0.75rem
0.5rem
1rem
--size-m
1rem
0.75rem
1.5rem
--size-l
1.5rem
1rem
2rem
--size-xl
2rem
1.5rem
3rem
--size-2xl
3rem
2rem
4rem
--size-3xl
4rem
3rem
6rem
Values are shown at the default --size-unit of 0.25rem. Like the base scale, every density step is a multiple of --size-unit, so it follows the root font size, the data-fluid profiles and the large-text accessibility theme, all of which work by changing that unit.
Density also adjusts reading rhythm: compact sets line-height: 1.4 and a smaller --font-size-s (0.8125rem); spacious sets line-height: 1.8.
Values already resolved outside the region — only tokens used inside the subtree pick up the new scale. A custom property declared on :root as var(--size-m) was resolved at the root, so it keeps the default value inside a density region. Declare derived tokens on the element that uses them, or inside the region.
Type scale — --font-size-* tokens are untouched, except --font-size-s in compact.
Color, border-radius and shadow tokens — unaffected.
Component-specific tokens like --button-padding-inline — unaffected unless they reference --size-* where they are used.
If you want a denser feel for body text too, layer this attribute with a smaller --font-size-m in your theme.
Accessibility
compact sets --font-size-s to 0.8125rem (13px at the default root size) and line-height: 1.4. Keep small text for secondary information, and check legibility in compact regions.
Users who override text spacing (WCAG 1.4.12) or enlarge text must not lose content. Because the density scale is in rem multiples, spacing grows with the root font size; avoid fixed heights in compact regions so content can expand.
Compact spacing shrinks the space around controls, not the controls' own minimum target size. Check that buttons and links in dense toolbars and tables still meet the 24×24px target size (WCAG 2.5.8).
When to use vs theming
Pick data-layout-density when the whole information density of a region needs to shift — admin dashboards, data-heavy tables, signed-in app shells. Pick a custom theme when only the look (colors, typography, shadows) should change. The two compose: an admin section can use data-layout-density="compact" with the standard brand theme above it.
Related
data-page-layout — commonly paired (compact density on a dashboard page layout).
data-layout + data-layout-gap — the gap scale recomputes automatically.
Fluid Scaling — viewport-responsive --size-unit; density composes with it.
data-density on <table> — per-component row density.
VB themes — orthogonal; density is structural, themes are decorative.