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

Placeholder text via data attributes. Fill any element with lorem ipsum, specify word counts, sentence counts, or list items. Auto-detects language for Japanese, Chinese, Korean, Arabic, Hebrew and Cyrillic corpuses.

Overview

The data-lorem attribute fills any text-containing element with placeholder text. Built-in corpuses for Latin, Japanese, Chinese, Korean, Arabic, Hebrew and Cyrillic keep the browser bundle lean (~6KB) without requiring external dependencies.

How It Works

  1. On DOMContentLoaded, finds all elements with data-lorem
  2. Parses the attribute value to determine word count, sentence count, or mode
  3. Detects the appropriate corpus from the element's lang attribute (or its ancestors)
  4. Fills the element's textContent (or innerHTML for list items)
  5. Marks the element with data-lorem-filled and translate="no"
  6. A MutationObserver watches for dynamically added elements

Attributes

Attribute Type Description
data-lorem string Controls output. See Values table below.
data-lorem-filled boolean Set automatically after content is injected. Used as CSS hook for wireframe integration.
data-lorem-init boolean Set automatically to prevent double-binding. Do not set manually.

Values

ValueResultExample
(empty)~50 words of lorem ipsum<p data-lorem></p>
5050 words<p data-lorem="50"></p>
3 sentences3 full sentences<p data-lorem="3 sentences"></p>
heading5 words (heading-length)<h2 data-lorem="heading"></h2>
5 items5 <li> elements (on <ul>/<ol>)<ul data-lorem="5 items"></ul>
cjkJapanese placeholder corpus (~80 characters)<p data-lorem="cjk"></p>
chineseChinese (Simplified) placeholder corpus (~80 characters)<p data-lorem="chinese"></p>
koreanKorean placeholder corpus<p data-lorem="korean"></p>
arabicArabic placeholder corpus<p data-lorem="arabic"></p>
hebrewHebrew placeholder corpus<p data-lorem="hebrew"></p>
cyrillicCyrillic placeholder corpus<p data-lorem="cyrillic"></p>

Word Count

Pass a number to get that many words.

Sentence Count

Use N sentences for full sentences (singular sentence also works).

Headings

Use heading for short, heading-length text (5 words).

List Items

On <ul> or <ol>, use N items to generate <li> elements.

Multi-language Support

The corpus auto-detects from the lang attribute on the element or any ancestor. You can also force a specific corpus by name.

Language detection
Language codesCorpus
jaJapanese (cjk), counted in characters
zhChinese, Simplified (chinese), counted in characters
koKorean (korean), counted in words
ar, fa, urArabic (arabic)
heHebrew (hebrew)
ru, uk, bg, srCyrillic
any other / noneLatin (default)

Production Transition

Replace the content and remove data-lorem. No structural changes needed.

Wireframe Integration

In data-wireframe="lo" mode, elements with data-lorem-filled get abstract text-block styling: extra letter-spacing and reduced opacity.

Dynamic Elements

Elements added to the DOM after page load are automatically filled via a MutationObserver.

Accessibility

  • Sets translate="no" on filled elements so translation tools skip placeholder text
  • Does not set aria-hidden — screen readers should still read placeholder content during testing to verify document structure
  • Filled list items use semantic <li> elements
↑