Created
December 14, 2021 15:09
-
-
Save r3b/84b054cc81bd26df55966e42c860bb12 to your computer and use it in GitHub Desktop.
Highlight images without ALT attributes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
const style = document.createElement("style"); | |
style.setAttribute("media", "screen") | |
document.head.appendChild(style); | |
const sheet = style.sheet; | |
sheet.insertRule(`img[alt=""], img[alt="Alt Text"], img:not([alt]):not([role*="presentation"]){border:2px dashed red;}`) | |
sheet.insertRule(`img[role*="presentation"], img[role*="none"]{border:2px solid blue;}`) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment