<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/a11y-syntax-highlighting-has-been-updated-zedayjifv" -->

---
title: a11y-syntax-highlighting has been updated | daily.dev
description: Eric Bailey released an updated version of his a11y-syntax-highlighting library, a set of WCAG-conformant syntax highlighting themes for PrismJS and...
canonical: https://daily.dev/posts/a11y-syntax-highlighting-has-been-updated-zedayjifv
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: a11y-syntax-highlighting has been updated | daily.dev
og:description: Eric Bailey released an updated version of his a11y-syntax-highlighting library, a set of WCAG-conformant syntax highlighting themes for PrismJS and...
og:url: https://daily.dev/posts/a11y-syntax-highlighting-has-been-updated-zedayjifv
og:image: https://api.daily.dev/og/posts/ZEDayJiFV.png
og:image:alt: a11y-syntax-highlighting has been updated
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# a11y-syntax-highlighting has been updated

**[Eric Bailey](https://daily.dev/sources/ericwbailey)** · 6 min read · 0 upvotes · 0 comments

## Summary

Eric Bailey released an updated version of his a11y-syntax-highlighting library, a set of WCAG-conformant syntax highlighting themes for PrismJS and highlight.js originally forked from solarized-prism-theme seven years ago. The new release adds support for Forced Colors mode, wraps styles in a Cascade Layer to avoid class name collisions, uses CSS Custom Properties for easier theming, groups selectors with :where() to keep specificity low, and normalizes all colors to hsla() notation. The post also covers the project's origin story (a question about whether WCAG contrast requirements apply to code themes), community contributions including Vim support and the Forced Colors feature request, and future plans focused on a possible VS Code theme.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://ericwbailey.website/published/a11y-syntax-highlighting-has-been-updated>

## Questions this post answers

### Does WCAG SC 1.4.3 contrast minimum apply to code syntax highlighting themes?

Yes, code syntax highlighting themes must meet minimum color contrast values to be WCAG conformant, including colors used for comments. Many popular syntax highlighting themes fail this requirement, particularly with low-contrast comment colors, which is why the a11y-syntax-highlighting library was created as a conformant alternative for PrismJS and highlight.js.

_Developers auditing color contrast in their code blocks can track accessibility guidance like this on daily.dev._

### How do I support Windows Forced Colors mode in a custom CSS theme?

Use the forced-colors media feature combined with CSS Custom Properties, since Forced Colors mode works well with custom properties for overriding theme values. The a11y-syntax-highlighting library added Forced Colors mode support in its latest release by structuring its styles with custom properties, letting the browser's forced palette take over cleanly instead of breaking the layout.

_Anyone styling for forced-colors and high-contrast modes can follow updates on techniques like this via daily.dev._

### What is a CSS Cascade Layer used for when styling third-party libraries like PrismJS?

A Cascade Layer isolates a library's styling rules so generic class names, like PrismJS's 'token' and 'number', don't collide with a site's own CSS. Wrapping the a11y-syntax-highlighting theme in a Cascade Layer means any style leakage from those generic selectors can be resolved more easily by the site consuming the theme.

_Developers untangling CSS specificity conflicts can keep up with patterns like cascade layers on daily.dev._

## Similar posts on daily.dev

- [Bootstrap VS Code Theme](https://daily.dev/posts/bootstrap-vs-code-theme-kb1mcfsdu) · Bootstrap · 1 upvotes · 0 comments
- [Everyone is getting syntax highlighting wrong – Frontend Masters Blog](https://daily.dev/posts/everyone-is-getting-syntax-highlighting-wrong-frontend-masters-blog-vh7fg1q2n) · Frontend Masters · 1 upvotes · 0 comments
- [Algorithmic Theming Engines: Building Self-Correcting Color Systems With contrast-color\(\) — Smashing Magazine](https://daily.dev/posts/algorithmic-theming-engines-building-self-correcting-color-systems-with-contrast-color-smashing-afte9iv44) · Smashing Magazine · 4 upvotes · 0 comments
- [No-Hassle Visual Studio Code Theming: Building an Extension](https://daily.dev/posts/no-hassle-visual-studio-code-theming-building-an-extension-wyiwzoyp3) · CSS-Tricks · 2 upvotes · 0 comments
- [Issue \#747: CSS that picks its own readable text color — Frontend Focus](https://daily.dev/posts/issue-747-css-that-picks-its-own-readable-text-color-frontend-focus-jnddyuttw) · Frontend Focus · 3 upvotes · 0 comments

---

Tags: [#css](https://daily.dev/tags/css), [#accessibility](https://daily.dev/tags/accessibility)

[View this post on daily.dev](https://daily.dev/posts/a11y-syntax-highlighting-has-been-updated-zedayjifv)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"a11y-syntax-highlighting has been updated","url":"https://daily.dev/posts/a11y-syntax-highlighting-has-been-updated-zedayjifv","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/a11y-syntax-highlighting-has-been-updated-zedayjifv"},"datePublished":"2026-09-20T07:44:36.522Z","dateModified":"2026-09-20T07:49:12.102Z","description":"Eric Bailey released an updated version of his a11y-syntax-highlighting library, a set of WCAG-conformant syntax highlighting themes for PrismJS and...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/32729045afb8b000fcc16eb289e08287?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/32729045afb8b000fcc16eb289e08287?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Eric Bailey","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Eric Bailey","logo":"https://media.daily.dev/image/upload/s--r1vwe6z1--/f_auto,q_auto/v1789890198/logos/ericwbailey?_a=BAMAMicg0","url":"https://daily.dev/sources/ericwbailey"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/a11y-syntax-highlighting-has-been-updated-zedayjifv","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"css,accessibility","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Eric Bailey","item":"https://daily.dev/sources/ericwbailey"},{"@type":"ListItem","position":3,"name":"a11y-syntax-highlighting has been updated"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/a11y-syntax-highlighting-has-been-updated-zedayjifv#faq","mainEntity":[{"@type":"Question","name":"Does WCAG SC 1.4.3 contrast minimum apply to code syntax highlighting themes?","acceptedAnswer":{"@type":"Answer","text":"Yes, code syntax highlighting themes must meet minimum color contrast values to be WCAG conformant, including colors used for comments. Many popular syntax highlighting themes fail this requirement, particularly with low-contrast comment colors, which is why the a11y-syntax-highlighting library was created as a conformant alternative for PrismJS and highlight.js. Developers auditing color contrast in their code blocks can track accessibility guidance like this on daily.dev."}},{"@type":"Question","name":"How do I support Windows Forced Colors mode in a custom CSS theme?","acceptedAnswer":{"@type":"Answer","text":"Use the forced-colors media feature combined with CSS Custom Properties, since Forced Colors mode works well with custom properties for overriding theme values. The a11y-syntax-highlighting library added Forced Colors mode support in its latest release by structuring its styles with custom properties, letting the browser's forced palette take over cleanly instead of breaking the layout. Anyone styling for forced-colors and high-contrast modes can follow updates on techniques like this via daily.dev."}},{"@type":"Question","name":"What is a CSS Cascade Layer used for when styling third-party libraries like PrismJS?","acceptedAnswer":{"@type":"Answer","text":"A Cascade Layer isolates a library's styling rules so generic class names, like PrismJS's 'token' and 'number', don't collide with a site's own CSS. Wrapping the a11y-syntax-highlighting theme in a Cascade Layer means any style leakage from those generic selectors can be resolved more easily by the site consuming the theme. Developers untangling CSS specificity conflicts can keep up with patterns like cascade layers on daily.dev."}}]}
```

