0.2.0 • Published 3 years ago

a11y-syntax-highlighting v0.2.0

Weekly downloads
11
License
MIT
Repository
github
Last release
3 years ago

a11y-syntax-highlighting

Accessible light and dark syntax highlighting themes.

Support

Libraries

Applications

Misc

  • Carbon
  • JSON (remember to include alt text with your image!)

Roadmap

Themes

a11y-dark

The a11y-dark theme being applied to the HTML of the Prism.js website. Screenshot.

  • Light text on a dark background.
  • Background color of #2b2b2b.
  • WCAG AAA compliant for color contrast.
ColorHexRatioNormal TextLarge Text
Bright Turquoise#00e0e08.59:1AAAAAA
Chino#d4d0ab9.04:1AAAAAA
Conifer#abe3389.29:1AAAAAA
Gold#ffd70010.09:1AAAAAA
Snuff#dcc6e08.90:1AAAAAA
Spring Wood#f8f8f213.28:1AAAAAA
Vivid Tangerine#ffa07a7.12:1AAAAAA

a11y-light

The a11y-light theme being applied to the HTML of the Prism.js website. Screenshot.

  • Dark text on a light background.
  • Background color of #fefefe.
  • WCAG AA compliant for color contrast. WCAG AAA compliance forces the values on a light background to be too similar to each other to be used effectively for syntax highlighting.
ColorHexRatioNormal TextLarge Text
Chelsea Gem#aa5d004.87:1AAAAA
Allports#0072994.51:1AAAAA
Dove Gray#6969695.44:1AAAAA
Emperor#5454547.51:1AAAAAA
Japanese Laurel#0080005.09:1AAAAA
Thunderbird#d91e185.02:1AAAAA

High Contrast Mode

Both themes have enhanced support for Windows High Contrast Mode when possible:

The a11y-dark theme responding to Windows High Contrast Mode. Screenshot.

Used by

Run across it being used elsewhere? Let me know!

Thanks