Vanilla Breeze

accessibility-specimen

WCAG contrast-ratio table for color pairs + a11y checklist for design-system docs.

Overview

<accessibility-specimen> is a docs-focused specimen with two modes: a tabular contrast-ratio display for color pairs, and a slot-driven a11y checklist with status icons. Used in design-system docs to make accessibility evidence visible alongside tokens.

Contrast mode (default)

Author each color pair as a <button data-fg data-bg [data-label]> child. The component renders a table with the pair label, a styled sample, the WCAG 2.x contrast ratio, and pass/fail badges for AA, AA Large, AAA, and AAA Large.

Color values can be hex (3/6/8 char), rgb()/rgba(), or named — anything the browser can resolve via computed style is supported.

Checklist mode

Author a <ul> of items with data-status="pass|fail|warn|na". The component decorates each item with a status icon and a screen-reader-only status announcement.

WCAG thresholds

BadgeThresholdMeaning
AA≥ 4.5:1Body / normal text passes WCAG 2.x AA.
AA Large≥ 3.0:1Large text (≥ 18pt or ≥ 14pt bold) passes AA.
AAA≥ 7.0:1Body text passes AAA.
AAA Large≥ 4.5:1Large text passes AAA.

Design-system family

Attributes

AttributeTypeDefaultDescription
typestringcontrastcontrast | checklist

Per-pair attributes (contrast mode, on <button>)

AttributeDescription
data-fgForeground color (required).
data-bgBackground color (required).
data-labelDisplay label (defaults to button text content).

Per-item attributes (checklist mode, on <li>)

AttributeDescription
data-statuspass | fail | warn | na (default na).