Skip to content

Accessibility

phil/footnotes-sidenotes
PointWhat the output does
Reference and noteA link to the note, with the role doc-noteref and the accessible name "Note 1", and a link back, with doc-backlink and "Back to reference 1"
A note referenced several timesOne backlink per reference, each named with its occurrence
The notes regionA section with doc-endnotes, named by its heading through aria-labelledby
The list of notesrole="list" on the ol: the stylesheet removes its markers, which would take the list semantics away in some browsers
Margin notesrole="note" on the note, which stands in the text right after its mark, so a screen reader meets the two together
The narrow toggleA real checkbox, focusable and named "Show note 1", with a visible focus ring on its label and a target of at least 24 pixels
Without a scriptEverything works: a link, a checkbox and CSS
Reduced motionThe one animation of the sheet, the opening of a note, runs only under prefers-reduced-motion: no-preference
A link opened on a note:target shows a note folded on a narrow viewport and marks it with the focus ring
Several documents on a pageEvery identifier starts with a prefix; give two when one document is shown twice

Labels

NoteLabels holds the words a reader hears or sees. NoteLabels::english(), french() and forLocale() give the ones the package ships; an application builds its own for another language, with %label% and %occurrence% in them.

new NoteLabels('Anmerkungen', 'Anmerkung %label%', 'Zurück zu Verweis %label%', 'Zurück zu Verweis %label%, Vorkommen %occurrence%', 'Anmerkung %label% zeigen');