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…
VB's one callout primitive: note, info, tip, warning and danger boxes, with optional speech and notched shapes. markdown-viewer renders :::kind blocks with the same markup.
Overview
data-callout turns a block element into a callout: a tinted box with an accent border on its start edge. Its value is a token list holding one kind (the meaning and colour) and, optionally, one shape (the outline). It is CSS-only and works on any block element. Use <aside> for notes and warnings, and <blockquote> for a quoted speech callout.
This is the only callout in Vanilla Breeze. <markdown-viewer> renders its :::warning blocks as <aside data-callout="warning" role="note">. Markdown callouts and hand-written ones therefore look identical and use the same theme hooks.
Usage
Put the kind in the attribute and start with a visible title. The data-callout-title marker on the title paragraph gives it tighter spacing. The title states the meaning in words, so the callout does not rely on colour alone.
A warning callout
1234
<asidedata-callout="warning"role="note"><pdata-callout-title><strong>Warning</strong></p><p>Deleting a project also deletes its deploy history.</p></aside>
To give a kind a shape, add the shape as a second token:
Kind plus shape
12345678
<asidedata-callout="info notched"role="note"><pdata-callout-title><strong>Configuration</strong></p><p>The bevel size follows --shape-bevel.</p></aside><blockquotedata-callout="speech"><p>Shipping on a Friday was a great idea.</p></blockquote>
Options
Kinds
Token
Accent / background
Use for
(none) or note
--color-border-strong / --color-surface-raised
Neutral asides and general notes
info
--color-info / --color-info-subtle
Background context
tip
--color-success / --color-success-subtle
Shortcuts and recommendations
warning
--color-warning / --color-warning-subtle
Things that can go wrong
danger
--color-error / --color-error-subtle
Data loss, security, anything irreversible
Shapes
Token
Outline
Notes
(none)
Accent border on the start edge, rounded on the end side
Works in every browser
speech
Rounded box with a tail at the bottom start corner
No accent border. Reserves --callout-tail of extra bottom padding for the tail.
notched
Bevelled top end corner
Keeps the accent border on the straight start edge
The shapes need CSS shape(). Browsers without it show the plain rectangular callout, which keeps the same colours. Packs can add shapes too: the journal pack adds sticky, a sticky note, under data-theme="journal".
Styling
Custom property
Default
Effect
--callout-accent
Set by the kind
Colour of the start-edge border
--callout-bg
Set by the kind
Fill. It accepts gradients. Shaped callouts paint it inside the shape.
--callout-tail
1rem
Height of the speech tail and of the padding reserved for it
--shape-bevel
20px
Size of the notched corner cut. It is a shared shape token, and the cyber and kawaii themes change it.
Shapes are painted on a ::before layer behind the content. The callout itself is never clipped. Themes therefore set --callout-bg rather than background, and draw glows with filter: drop-shadow(), which follows the shape.
Accessibility
Say the kind in words. The colour is decoration. Start every callout with a visible title such as "Warning" or "Tip". <markdown-viewer> always renders one.
Pick the element for its meaning. An <aside> inside <main> or an article is a complementary landmark. Give it role="note" when it belongs to the surrounding text, as markdown-viewer does, so it does not add one landmark per callout. Use <blockquote> only for quotations.
Do not use it for live alerts. A callout is static content. For messages that appear in response to an action, use role="alert" or role="status" on the element that receives the text.
Focus rings survive. The shape is painted behind the content and nothing is clipped, so links and buttons inside keep their full focus outline.
Forced colours and print. Backgrounds are flattened or dropped, so every callout gets a real CanvasText (or currentColor) frame with a thick start edge. Shaped callouts become plain framed boxes.
Right-to-left. The accent border, the radii, the speech tail and the notch all follow the writing direction.