3 ms·
Class names should not be semantically relevant. Typically, class names aren't announced by screen reader technology. In this particular case, I think better de
by JMTQp8lwXL 6y ago
Class names should not be semantically relevant. Typically, class names aren't announced by screen reader technology. In this particular case, I think better developer tooling is the solution. An option to hide the class attribute would dramatically simplify that DOM view. It's also possible those class names could be mapped to some pre-minified, human-readable values.
- dndvr 6y agoSo source maps for html?
- JMTQp8lwXL 6y agoCSS files already have source maps, which give you the map between the original and compiled class name. You need better developer tooling that would show the pre-compiled class name when viewing the DOM. Feeds into the "better developer tooling" concept.
- yunruse 6y agoThat’s true, but well-named semantic classes aid with other accessibility purposes. Making elements easy to target means screen scrapers and user themes can be maximally effective in targeting the right elements. Some user themes are for visual nicety, sure, but they might be essential aids to some. Making it easier to data-grab with BeautifulSoup etc means any data shown is more portable, too. Data scraping is all sorts of useful, and having classes that aren’t minified garble makes it a considerable amount easier to target.
- JMTQp8lwXL 6y agoEven with the best of intentions, DOM structures can change without advanced notice. Instead of scraping via DOM structure, why not screenshot a webpage and use OCR? I think the solution to the scraping problem is being viewed narrowly.
- taeric 6y agoThis suggestion is a hilarious admission that hypertext as conceived failed. And that makes me rather sad.
- JMTQp8lwXL 6y agoIt didn't fail. People don't want others scraping to protect their businesses. And that's how we've ended up with highly obfuscated HTML. If it failed, it wouldn't work at all. HTML was designed to display documents, not for scraping purposes. You know what is designed to be scraped? An actual application programming interface.
- MereInterest 6y agoAs somebody who has only dabbled in web programming, I thought the entire purpose of having CSS class names was to have them be semantically relevant. That way, your HTML could read class="appendix-reference" instead of class="light-blue-4 green-background-2 underline apply-hovertext".