Text Spacing Bookmarklet test in Accessibility Insights
See original GitHub issue#2564 Is your feature request related to a problem? Please describe. Text Spacing defines the success criterion https://www.w3.org/TR/WCAG21/#text-spacing But tools are not yet standardized to test this area.
Describe the desired outcome
A precise bookmarklet test which both users and testers can use to achieve/verify text spacing on a website.
Describe alternatives you’ve considered
IFrames
https://www.html5accessibility.com/tests/tsbookmarklet.html
javascript:(function(){ var style = document.createElement(%27style%27), styleContent = document.createTextNode(%27* { line-height: 1.5 !important; letter-spacing: 0.12em !important; word-spacing: 0.16em !important; } p{ margin-bottom: 2em !important; } %27); style.appendChild(styleContent ); document.getElementsByTagName(%27head%27)[0].appendChild(style); var iframes = document.querySelectorAll(%27iframe%27);for (var i=0; i<iframes.length; i++) {try{iframes[i].contentWindow.document.getElementsByTagName(%27head%27)[0].appendChild(style); } catch(error) { console.log(%27Bookmarklet error: %27+error)}}})();
CSS
https://dylanb.github.io/bookmarklets.html
javascript:(function()%7B%0A%09document.querySelectorAll('*').forEach(function%20(el)%20%7B%0A%09%09if%20(el.nodeName.toLowerCase()%20%3D%3D%3D%20'p')%20%7B%0A%09%09%09el.style.setProperty('margin-bottom'%2C%20'2em'%2C%20'important')%3B%0A%09%09%7D%0A%09%09el.style.setProperty('line-height'%2C%20'1.5'%2C%20'important')%3B%0A%09%09el.style.setProperty('letter-spacing'%2C%20'0.12em'%2C%20'important')%3B%0A%09%09el.style.setProperty('word-spacing'%2C%20'0.16em'%2C%20'important')%3B%0A%09%7D)%0A%7D)()%3B
Above bookmarklets does not cover all kinds of websites.
Additional context
More info on bookmarklets is here https://www.digitala11y.com/accessibility-bookmarklets-testing/
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:27 (11 by maintainers)
@ferBonnin I presume we don’t want this to be closed?
This issue has been automatically marked as stale because it is marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for contributing to Accessibility Insights!