3 ms·
The issue is that the compatibility and styling (animations etc.) are not fully supported or available. This should have been standardised much earlier, alas he
by grenoire 7y ago
The issue is that the compatibility and styling (animations etc.) are not fully supported or available. This should have been standardised much earlier, alas here we are with a half-assed solution to a very common pattern.
- jraph 7y agoI guess you can always hack something in Javascript if you wish to have animations, which is always better than to go with an implementation in full Javascript.
- grenoire 7y agoThe one thing that does not stop boggling my mind on a daily basis is the lack of a consistent feature detection and the subsequent fallback mechanism for the web. I need to look at all these weird angles and use polyfills just to check if the feature is there in the first place. Even then, I cannot accomplish this without JS, and cannot react to it without JS. It's not a choice I have, so fuck it: I'll make it viewable without JS, and usable with JS.
- jraph 7y agoYou can always detect whether tag <foo> is supported in JavaScript by testing whether HTLMFooElement is defined (but I understand you are speaking more generally). I understand your feeling, and by making it usable without JavaScript you are already going a long way, but using those tags also makes your pages accessible. Making your pages beautiful with animations is only extra. Things already work out of the box in any case without <details> without effort, only better if it is supported. HTML is mostly designed to gracefully degrade, detection is not always necessary. How would you like things to be handled? Handling retro compatibility is hard and I find HTML does a good job at it.
- grenoire 7y agoOut of a stance that is now more political than anything, the applications I've been building are entirely operating with server-side HTML templates with absolutely minimum to no JS (only for the occasional page load event or whatnot). When you respond to requests in under 100ms (plus network latency), you don't need an SPA layer to fool people into thinking that they're not in a web page. Bosses are particularly impressed with the speed.
- jraph 7y agoAnd I guess they are also simpler code wise? :-) I've built a website like that, for someone drawing comics. Fully works in simple HTML, looks better with CSS, and faster and slightly more enjoyable with JS. The JS avoids jumps and flashes (especially annoying since the website has a black background) when opening a page by only reloading relevant parts so the browser does not need to fully redraw the website, with great care to handle history correctly and consistently with what would happen with JS disabled.
- izietto 7y agoThere are pretty straightforward CSS-only solutions too, for example: https://stackoverflow.com/a/38215801/584552 https://stackoverflow.com/a/38215801/584552
- aoeusnth1 7y agoAnd I bet the CSS animations look a lot less janky than JS equivalents.
- rebolek 7y agoAs an user, animations are not my issue at all.
- TeMPOraL 7y agoIndeed. Or rather: as an user, the animations only an issue when they're broken (or performance-intensive). Which immediately suggests a way for correctly doing such expandable paragraphs: just don't animate them if you can't make it work perfectly everywhere.
- discreditable 7y agoSounds like a good feature to me!
- layoutIfNeeded 7y agoDon’t style it, let the user agent use the appropriate style. Don’t animate it, let the user agent use the appropriate animation.