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

split-surface

Resizable panel splitter with two layers of progressive enhancement: attribute init and full web component.

Overview

The splitter provides resizable panel support as a two-layer progressive enhancement story — from attribute init to full web component — matching a "platform-first, enhance upward" philosophy.

Layer 1: Attribute Init

Light JS (about 200 lines). Apply data-splitter to a container. A small init script injects a full-height drag divider between the first two children with pointer and keyboard events.

Vertical Splitting

Constraints and RTL

Set data-min and data-max on the first child to constrain how far the divider can move; the initial position is clamped into that range. In right-to-left containers the first panel sits on the right and drag and arrow keys mirror.

The attribute utility fires splitter:resize ({ position }); see data-splitter.

Keyboard

KeyAction
ArrowLeft / ArrowRightMove divider 1% in the arrow's direction (mirrored in RTL)
Shift + ArrowMove divider 10%
HomeMove to minimum
EndMove to maximum

Layer 2: Web Component

Full component. Self-contained <split-surface> element with persistence, collapsible panels, custom events, and JS API.

All Attributes

AttributeValuesDefaultDescription
direction"horizontal", "vertical"horizontalSplit axis. Observed
positionnumber50Default split position as a percentage (0–100). A persisted value wins over it on load. Observed (changes apply), not reflected: read the live value from the position property
minnumber10Minimum panel size percentage. Observed
maxnumber90Maximum panel size percentage. Observed
persiststring—VBStore key suffix under namespace 'layout' (vb:layout:split:{key}); stores { position, collapsed } after user resizes and wins over the position attribute on load
collapsibleboolean—Enter or double-click on the divider collapses / expands the first panel (collapsed panel is inert; aria-valuemin becomes 0). Observed
data-label-resizestringResize panelsAccessible name of the divider
data-label-collapsedstringCollapsedDivider aria-valuetext while the first panel is collapsed (otherwise "{n}%")

Position and persistence

position is the default split. With persist, the user’s last layout (position and collapsed state, stored under vb:layout:split:{key} after they resize) wins over position on the next load; reset() clears it and returns to position. Changing position, min, max or direction after upgrade is applied; the attribute is not reflected, so read the live value from the position property.

Collapsing

With collapsible, Enter or a double-click on the divider collapses the first panel to zero and back. While collapsed the panel is inert (its links and controls leave the tab order), the divider reports aria-valuenow="0" with aria-valuetext “Collapsed” (data-label-collapsed to translate), and any arrow, Home or End key expands it again — the keyboard is never trapped. split-surface:state(collapsed) styles the collapsed state.

Required Structure

ElementRequiredDescription
first childyesFirst panel content (the one the divider resizes and collapses)
second childyesSecond panel content — divider is auto-created between them

Events

EventDetailDescription
split-surface:resize{ position, source }Fired when the split changes; source is 'pointer', 'keyboard', 'api' or 'attribute'. Not fired on initial load / reconnect
split-surface:collapse{ collapsed, source }Fired when the first panel is collapsed or expanded

JavaScript API

Property / MethodTypeDescription
element.positionnumberGet/set the live position (0–100, clamped to min/max; 0 while collapsed). Non-numeric values are ignored.
element.collapsedbooleanGet/set collapsed state
element.reset()methodExpand, restore the position attribute (or 50), clear persistence

The divider is created asynchronously (after the persisted layout is read), so properties and reset() set right after creating or appending the element are queued and applied once it is ready.

Keyboard Navigation

Both layers support the same keyboard controls:

KeyAction
ArrowLeft / ArrowRightMove divider 1% in the arrow's direction (side-by-side; mirrored in RTL)
ArrowUp / ArrowDownMove divider 1% (stacked)
Shift + ArrowMove divider 10%
HomeMove to minimum position
EndMove to maximum position
EnterCollapse / expand the first panel (<split-surface collapsible> only)

While collapsed, any arrow, Home or End key expands the panel again.

Accessibility

Separator Role

The divider has role="separator" with aria-valuenow, aria-valuemin, aria-valuemax and aria-controls (the first panel; an id is generated when missing). aria-orientation is the divider's own axis: vertical for side-by-side panels, horizontal for direction="vertical". Screen readers announce the current position; <split-surface> adds an aria-valuetext such as “30%” or “Collapsed”. When collapsible is set, aria-valuemin is 0 because the panel can reach zero.

The accessible name defaults to "Resize panels"; set data-label-resize to translate or specialise it.

Keyboard Support

The divider is focusable (tabindex="0") and responds to arrow keys. Shift + arrow provides larger steps. Home and End jump to min/max. On a collapsible <split-surface>, Enter collapses and expands, following the APG window-splitter pattern, so collapse is not mouse-only.

Forced colors

In Windows High Contrast the divider is drawn in CanvasText with a Canvas grip, and hover, drag and focus switch to Highlight, for both layers.

Touch Support

The divider uses touch-action: none and setPointerCapture for reliable pointer drag behavior across devices. A cancelled gesture (pointercancel or lost capture) ends the drag cleanly.

Styling

The divider uses the .split-divider class shared by both layers. The ::after pseudo-element renders a grip indicator.

Progressive Enhancement

Without JavaScript, <split-surface> renders as a simple two-column flex layout. The :not(:defined) selector provides the fallback. Once JS registers the component, the divider appears.

Which Layer to Choose

LayerJSKeyboardARIAPersistenceBest for
data-splitter~200 linesYesYesNoEnhanced layout containers with accessibility
<split-surface>~430 linesYesYesYesFull-featured standalone component (collapse, persistence, JS API)

Related

↑