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

reversed

Ordered-list numbering: reversed counts down, start sets the first number, li value jumps the count, and type picks the marker. VB widens the indent for long markers.

Overview

The reversed attribute makes an <ol> count down instead of up. Three companions complete the numbering controls: start sets the first number, value on an <li> jumps the count, and type picks the marker style. Because these are HTML attributes, the numbers are part of the document, not just its styling.

Applies to:

  • reversed, start, type — <ol>
  • value — <li> whose parent is an <ol>

Values

AttributeValueDefaultEffect
reversedBooleanAbsent: counts upCounts down. Without start, the first item gets the number of items.
startInteger (may be 0 or negative)1, or the item count when reversed; an invalid value uses the defaultThe number of the first item.
valueIntegerAbsent: the next number in sequenceThis item's number. Following items continue from it.
type1, a, A, i, I1 (decimal)Decimal, lower or upper letters, lower or upper Roman numerals. Case matters.

Examples

Continue a split list

Top-ten countdown

Use reversed with start when the list shows only part of the count.

Jump the count

To change one number without moving the rest, set value on the next item too.

Roman numerals and letters

Use the type attribute, not an inline list-style-type. The marker type is part of the content (a legal clause "iv" is referred to as "iv"), and VB's indent rule recognises it.

In Vanilla Breeze

List markers sit in the list's inline-start padding. A marker wider than the padding ("VIII.", "100.") overflows the list edge and can be clipped. VB widens the indent from var(--size-l) to 2.5em for the lists that CSS can tell will have long markers (src/native-elements/lists/styles.css):

  • Any list with reversed, start, an li[value], Roman numerals (type="i" or "I"; attribute selectors on type ignore case in HTML), 27 or more lettered items, or 100 or more items gets the wider indent.
  • CSS cannot measure a marker. For very large start values or wide CSS list styles (cjk-ideographic, long arabic-indic counts), set --ol-indent in your stylesheet, for example ol.chapters { --ol-indent: 4em; }.
  • The rule uses :where(), so it has zero specificity and any class of yours overrides it.
  • The dyslexia accessibility theme (src/tokens/themes/_access-dyslexia.css) uses the same --ol-indent hook.

Accessibility

  • The items are read in document order (top to bottom); the numbers come from the attributes, not the order.
  • Whether a screen reader announces the actual number (for example "10" in a start="10" list) or only the position ("1 of 3") differs between screen readers and browsers. If the number carries meaning, such as a ranking, also put it in the item text, and test with the combinations your audience uses.
  • CSS counters (counter-reset, counter()) only change what is drawn. Numbering that matters should come from these attributes, so it is in the document.

Gotchas

  • reversed, start and type do nothing on <ul>.
  • start and value take integers even when type shows letters or Roman numerals: start="4" with type="a" starts at "d".
  • A reversed list without start renumbers every item when items are added or removed. Set start if the numbers must not change.
  • An inline style="list-style-type: …" overrides type visually but VB's indent rule cannot see it.

Related

  • <ol> and <li> — element references and VB list styles.
  • <ul> — unordered lists.

Which to choose

  • reversed / start / value / type — whenever the numbers mean something: steps, rankings, legal clauses, chapters.
  • --ol-indent — when markers are wider than VB's indent rule can predict.
  • CSS counters — decorative numbering only, such as numbered headings in a stylesheet.
↑