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

status-message

Inline notification banners for important messages. Use for success confirmations, warnings, errors, and informational notices.

Attributes

Attribute Values Default Description
data-variant info, success, warning, error, neutral info Alert type and color
data-filled boolean - Use solid background color
data-compact boolean - Reduce padding
data-dismiss-focus CSS selector next focusable element Where focus goes after the message is dismissed

Variants

Alerts come in five semantic variants for different message types.

With Icons

Add an icon-wc element with data-icon attribute for visual emphasis.

Filled Style

Add data-filled for a solid background color.

Simple Alerts

Alerts can be simple single-line messages without title.

With Dismiss Button

Add a <button data-dismiss> as a direct child to make the message closable. Activating it hides the message with the hidden attribute (use data-dismiss="remove" to remove it from the DOM instead). If focus was inside the message, it moves to the element matched by data-dismiss-focus, or else to the next focusable element after the message, so keyboard users keep their place.

Before hiding, the message fires a bubbling, cancelable status-message:dismiss event. Call preventDefault() to keep the message (for example to animate it out yourself).

Accessibility

Variant titles and compact text use the --color-*-text tokens, which meet WCAG AA on the subtle backgrounds; filled messages keep a visible border in forced-colours mode.

Live regions announce changes, not content that is already on the page. A message present at page load with role="status" is usually not announced, and role="alert" on page-load content is announced immediately by some screen readers and not at all by others. For messages that appear in response to an action, keep an empty role="status" (or role="alert") container in the page from the start and insert the <status-message> into it when the event happens.

Related

↑