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

ol

The ordered list element represents a collection of items where the sequence is meaningful.

Description

The <ol> element creates a numbered list of items. Each item is wrapped in an <li> element. Use ordered lists when the sequence of items matters — such as steps in a process, rankings, or any content where position is significant.

By default, items are numbered with decimal numerals (1, 2, 3...) and have start-side padding (left in left-to-right text, right in right-to-left) for indentation. The numbers sit in that padding, so lists that will carry long markers get a wider indent automatically — see Long markers and other scripts.

When to Use

  • Step-by-step instructions or tutorials
  • Recipes with sequential steps
  • Rankings or leaderboards
  • Table of contents
  • Legal document sections
  • Any content where position matters

When Not to Use

  • For unordered collections — use <ul>
  • For term-definition pairs — use <dl>
  • For groups of action buttons — use <menu>
  • For tabular data — use <table>

Default

Standard ordered list with decimal numbering.

Numbering Styles

Use the type attribute to change the numbering style. It accepts only the five values below; other counter styles (Arabic-Indic, CJK, Hebrew, Greek…) come from the CSS list-style-type property.

Type Value Numbering Style Example
1 (default) Decimal numbers 1, 2, 3...
A Uppercase letters A, B, C...
a Lowercase letters a, b, c...
I Uppercase Roman I, II, III...
i Lowercase Roman i, ii, iii...

Start, Reversed, and Value

Control numbering with the start, reversed, and value attributes.

In a reversed list without start, counting begins at the number of items, so the last item is 1. A value on an <li> resets the count from that item on (see <li>).

Attribute Values Description
type 1, A, a, I, i Numbering style
start Integer Starting number
reversed Boolean Count down instead of up
value (on <li>) Integer Override a specific item's number

Variants

.inline

Display list items horizontally. Numbers are removed in this variant — the order is still exposed to assistive technology, but sighted readers lose it, so keep the sequence evident from the content (or use nav.steps for a progress indicator).

.unstyled

Remove numbers and indentation for custom styling.

.meta

A compact inline list with separators between items, shared with <ul>. data-separator="pipe|dash|slash" works on <ol class="meta"> too.

Nested Lists

Ordered lists can be nested, and can mix with unordered lists for complex hierarchical content. Each nested <ol> restarts at 1 and uses decimal numbers at every depth (browsers do not vary the style by level the way they do for bullets), so set type on the inner list to tell the levels apart.

Long Markers and Other Scripts

List markers sit outside each item, in the list's inline-start padding (the right side in right-to-left text). VB's default indent fits one- and two-digit numbers. CSS cannot measure a marker, so VB widens the indent to 2.5em for the lists it can tell will carry longer ones: roman numerals (type="i" or type="I"), any start, reversed, an <li value>, 27 or more lettered items and 100 or more items.

For anything wider — a large start, CJK counter styles with full-width punctuation, long Arabic-Indic counts — set --ol-indent on the list. Script-specific counters come from CSS list-style-type; markers mirror to the right automatically under dir="rtl".

Accessibility

Screen Reader Behavior

  • Announced as a list with its item count
  • Items are announced by position (“2 of 4”). That position always counts from 1 — start, reversed and value change only the marker text
  • Chromium and Firefox expose the marker text with the item, so screen readers on those browsers usually read the visible number too; Safari/VoiceOver does not reliably read it. If the actual number matters (a numbered clause, a countdown), say it in the item text as well

Safari / VoiceOver

The .inline, .unstyled and .meta classes remove the markers with list-style: none, and Safari with VoiceOver may then stop announcing the element as a list. Add role="list" where the list structure matters:

Best Practices

  • Use ordered lists only when sequence matters
  • Keep step counts reasonable (avoid 50+ step lists)
  • Consider breaking very long lists into sections
  • Use type attribute for legal/academic numbering styles

CSS Properties

Property Value Description
padding-inline-start var(--ol-indent, var(--size-l)) Start-side indentation; the markers sit in it
padding-inline-start (roman, start, reversed, li[value], 27+ letters, 100+ items) var(--ol-indent, 2.5em) Wider indent for long markers

Custom Properties

Property Default Description
--ol-indent unset Explicit indent for one list; overrides both defaults above

Variant: .inline

Property Value
display flex
flex-wrap wrap
gap var(--size-s)
list-style none

Related

  • <ul> — Unordered list for non-sequential items
  • <li> — List item element (required child)
  • <dl> — Definition list for term-description pairs
  • <menu> — Semantic container for action button groups
  • article[data-numbered] — Outline numbering (1., 1.1.) for headings, figures and tables
  • reversed — Reversed, start, value and type for list numbering

Patterns Using This Element

The <ol> element serves as the semantic foundation for these patterns:

Timeline

Chronological events, order tracking, and activity feeds

↑