Design for all » Inclusive usability » Code highlighting
As soon as we want to make it look good, sharing program code on the web requires a bit of consideration for inclusiveness.
My tool of choice for embedding code snippets on websites is:
Prism
Instead of the default CSS styles, I use the a11y-optimized styles by Eric W. Bailey:
ericwbailey/a11y-syntax-highlighting: Accessible light and dark syntax highlighting themes
github.com/ericwbailey/a11y-syntax-highlighting
Eric W. Bailey maintains this repository of syntax highlighting styles that consider accessibility (e.g. for prism.js, to present code on websites).
Last edited: Dec 2022