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

ins

The ins element represents text that has been inserted into a document, styled with a green bottom border and subtle green background for tracking edits or showing revisions.

Description

The <ins> element indicates text that has been added to a document. It is the counterpart to <del> and the two are commonly used together to show document revisions. VB removes the browser default underline and replaces it with a subtle green background tint and a solid green bottom border, keeping insertions visually distinct from <u> annotations and <mark> highlights.

Like <del>, it supports cite and datetime attributes for machine-readable context about the insertion.

When to Use

  • Document revisions: Track additions in legal documents, contracts, or policies
  • Edit history: Show what was added in collaborative documents
  • Diff displays: Show added code or text in version comparisons
  • Corrections: Indicate new information that replaces deleted content
  • Track changes: Similar to "track changes" in word processors

When NOT to Use

  • Visual underline only: Use <u> or CSS for purely decorative underlines
  • New content without revision context: Only use when tracking changes matters
  • Relevance highlighting: Use <mark> for drawing attention without editorial semantics

Examples

Default

Displays with a subtle green background and a solid green bottom border indicating insertion.

.diff

Enhanced styling for diff displays with padding and rounded corners, ideal for code comparisons.

Document Revision

Pair <ins> with <del> to show before-and-after edits in running text.

Code Diff Display

Use the .diff class on both <ins> and <del> for compact, pill-shaped diff lines.

Block-Level Insertion

When <ins> wraps block content (paragraphs, lists, tables, headings, <pre>, <blockquote>, <details>, <form>, <fieldset>, sectioning elements and similar), VB detects it with :has() and turns the change into a block with the tint, padding, and an inline-start edge bar, so the styling covers the whole change instead of breaking across each child. No class is needed.

Annotated Changes

data-reason shows a small uppercase tag before the change. data-author appends the author's name after it; the name appears on hover, when focus is inside the change, always on touch screens, and in print.

Announced Changes

Most screen readers do not announce <ins> at all by default, so a listener hears the inserted words with no hint that they are an edit. Add data-announce to the change, or to any ancestor such as an article, to insert visually hidden “insertion start” / “insertion end” text around it.

Translate the announced words with custom properties holding quoted strings, set on the element or any ancestor:

When the change also has a visible data-reason or data-author, that annotation stays visible and carries the announcement as its alternative text.

Key Attributes

Attribute Description Example
datetime Date and time of the insertion in ISO 8601 format. Not visible, and not exposed by browsers to assistive technology; available to scripts. Show the date in visible text if readers need it. datetime="2024-01-15T10:30:00"
cite URL to a document explaining the change. Not rendered by the browser but useful for audit trails. cite="https://example.com/changelog"
data-reason VB: short visible tag before the change (e.g. correction, review). data-reason="correction"
data-author VB: author name shown after the change on hover, focus, touch screens, and in print. data-author="Ana"
data-announce VB: on the element or any ancestor, adds visually hidden “insertion start/end” text for screen readers. data-announce

ins vs mark

Both elements use a background tint, but they carry different semantics and VB distinguishes them visually:

Element Meaning VB Styling
<ins> Editorial change — text was added to the document Green background tint + green bottom border
<mark> Relevance highlight — not an edit Theme-colored background tint (no border)

Use <ins> when the content was editorially added (contracts, changelogs, diffs). Use <mark> for search results, quotation highlights, or status badges.

CSS Reference

The browser default underline is replaced with a solid bottom border. The tint and border come from the theme's --color-success-subtle and --color-success tokens, so they follow light and dark modes and every theme. The .diff variant adds inline-block display with padding for pill-shaped diff tokens.

Accessibility

  • Not announced by default: Most screen reader and browser combinations read <ins> content as ordinary text, with no indication that it was inserted. Where the edit matters to the meaning, add data-announce (see Announced Changes) or say so in the surrounding text
  • Dual visual cues: Bottom border and background color together ensure visibility, including for users who may not perceive color
  • Color contrast: The tint comes from the theme's success tokens, which are checked for contrast against body text
  • Datetime is not exposed: Browsers do not pass datetime to assistive technology; put the date in visible text when it matters

Screen Reader Behavior

With data-announce, users hear something like:

Related

  • <del> — Companion element for deleted text (use together for document revisions)
  • <s> — Strikethrough for content that is no longer accurate, without editorial semantics
  • <mark> — Highlighted text for reference (background tint without insertion semantics)
  • <u> — Wavy red underline for annotations (see VB underline styles comparison)
  • datetime — When the edit was made
  • cite — A URL explaining the edit
↑