4 ms·
> Developers no longer need to label their data with class-names or ids - it's only a courtesy to screen readers now. In general, screen readers don't use clas
by mwcampbell 5y ago
> Developers no longer need to label their data with class-names or ids - it's only a courtesy to screen readers now.
In general, screen readers don't use class names or IDs. In principle they can, to enable site-specific workarounds for accessibility problems. But of course, that's as fragile as scraping. Perhaps you were thinking of semantic HTML tag names and ARIA roles.
- ComputerGuru 5y agoAnything relying on id/class names has been broken since the advent of machine-generated names that come part and parcel with the most popular SPA frameworks. They’re all gobbly-dook now, which makes writing custom ad block cosmetic filters a real PITA.
- jchw 5y agoReact doesn’t do that. You may still find gibberish on hostile sites like Twitter which intentionally obfuscate class names, using something like React Armor.
- DylanSp 5y agoReact by itself doesn't do that, but CSS-in-JS libraries are fairly common in the React ecosystem, and most of them have random autogenerated class names.
- jchw 5y agoEven though this is a good point, I am somewhat disappointed that people downvoted a trivially correct statement. React is arguably the most popular web framework and it definitely doesn’t do this, nor does anything about it make it especially make sense to do this. Not every React app uses styled components or a CSS in JS solution at all. Arguably, a fair bit don’t. Anything using Blueprint doesn’t entirely use CSS in JS.