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-parallax

Section-local, transform-only depth motion driven by a CSS view-progress timeline. CSS-only, clipped by its group, and off under either reduced-motion switch.

Overview

data-parallax moves one media layer inside a section at a different rate from the page while that section scrolls through the viewport. It is CSS only: a view() progress timeline drives a transform, with no scroll listeners and no JavaScript. data-parallax-group on the section clips the moving layer so it never paints over neighbouring content.

Usage

What the CSS does:

  1. [data-parallax-group] gets overflow: clip and isolation: isolate, so the translated layer stays inside the section and a negative z-index stays behind the section's own copy.
  2. [data-parallax] animates from translateY(--vb-parallax-from) to translateY(--vb-parallax-to), both with scale(--vb-parallax-scale), over the element's cover range. will-change: transform is set only while that animation can run.
  3. Without motion it rests at translateY(--vb-parallax-from) scale(--vb-parallax-scale). See Accessibility and Browser support.

Options

AttributeValuesDefaultEffect
data-parallax"", subtle, medium, strong""Animates the element. Put it on the media layer (a <figure>, <img> or <picture>), not on the section. The presets set the custom properties below; empty uses their defaults.
data-parallax-groupboolean—On the section that holds the layer: clips overflow and isolates stacking.
Presets
Value--vb-parallax-to--vb-parallax-scale
(empty)-12%1
subtle-6%1.04
medium-12%1.08
strong-20%1.12

Events

None. It is CSS only.

Styling

Custom propertyDefaultControls
--vb-parallax-from0%translateY when the element enters the viewport, and at rest.
--vb-parallax-to-12%translateY when it leaves.
--vb-parallax-scale1Constant scale. Make it large enough that the layer's edges never show over the travel (about 1 + 1.5 × the travel, so 1.08 for 12%). It applies at rest too.

Set them in a stylesheet rather than a style attribute (the vb/no-inline-style conformance rule flags inline styles), or use a preset.

Only transform is animated, so the browser can composite the layer. Do not extend the keyframes to top, background-position or other layout properties.

Accessibility

  • Vestibular safety. Parallax (content moving at different speeds while you scroll) is a common trigger for dizziness and nausea in people with vestibular disorders (WCAG 2.3.3 Animation from Interactions). VB turns it off under prefers-reduced-motion: reduce and under VB's own setting, data-motion-reduced on the root (the settings panel's reduced-motion switch). The layer then rests at its from position and scale: same composition, no motion.
  • Only while scrolling. The motion is tied to scroll position and stops when the reader stops, so there is no auto-playing animation to pause (WCAG 2.2.2 does not apply).
  • Keep it small. Travel past about 25% feels disruptive. Use one layer per section; stacks of layers moving at different rates are hard to read and worse on small screens.
  • Decorative layer, readable copy. Text stays on a static layer above the image. Keep its contrast against every part of the image (a scrim helps), and give a decorative image alt="".
  • The static layout must work. If the page only makes sense with motion, the design is too aggressive.

Browser support

The animation needs animation-timeline: view(): Chrome and Edge 115+, Safari 26+. In Firefox scroll-driven animations are still a preview behind a flag (layout.css.scroll-driven-animations.enabled). The animation is wrapped in @supports, so other browsers get no animation declarations at all, with no JavaScript shim and no layout shift: the layer rests at translateY(--vb-parallax-from) scale(--vb-parallax-scale), exactly as under reduced motion.

Examples

Presets

Full-bleed hero

The demo above: a gradient figure behind a heading, the medium preset, and a scrim behind the copy for contrast.

↑