3 ms·
Maybe it’s the contrived example but I’m not convinced. First I understand that if a user disable JavaScript then it has a functioning fallback, but can’t accep
by hollowturtle 3y ago
Maybe it’s the contrived example but I’m not convinced. First I understand that if a user disable JavaScript then it has a functioning fallback, but can’t accept browser double rendering(first pass HTML, second JavaScript and with potential layout shift) and with the risk of breaking accessibility, one should take for granted that the tooltip library has proper accessibility integrated. Then one thing that I will never understand: why calling them web components and not just custom elements? And shouldn’t the purpose of custom elements be to avoid JavaScript as much as possible? I can’t see why they were spec’d in this way, what’s the purpose of custom HTML elements if I need to wait javascript to kick in? Give me the possibility to define custom elements in a declarative fashion directly inside HTML with the <template> tag and with styles scoped to that node. Eventually, if one wants, could add some JavaScript to further enhance the custom element. That way we could have expanded the web more and more.
Edit: spelling corrections
- simonw 3y ago"one should take for granted that the tooltip library has proper accessibility integrated" Really? My experience to date has been that the majority of libraries for things like tooltips fail to take accessibility into account at all.
- hollowturtle 3y agoI agree, and imo users of those libraries fails as well
- naasking 3y ago> First I understand that if a user disable JavaScript then it has a functioning fallback That isn't the only case. They could be on an unreliable internet connection and the JS fails to load. They could be referencing unpkg and it's down or otherwise unreachable. There could have been a syntax or other error that escaped testing that causes the JS to fail to execute. The point is that there are many failure modes that may cause the JS-only approach to fail to display anything at all, where the progressively enhanced version is still usable.