Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save WestonThayer/36851873087c4b5161b2be772b896dd9 to your computer and use it in GitHub Desktop.

Select an option

Save WestonThayer/36851873087c4b5161b2be772b896dd9 to your computer and use it in GitHub Desktop.
axe-core highlight what text nodes were passed by the color-contrast rule
// Drop in https://unpkg.com/axe-core in console, then...
(await window.axe.run()).passes.find(p => p.id === "color-contrast").nodes.forEach(n => n.target.forEach(t => document.querySelector(t).style.backgroundColor = "pink"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment