Is anyone else sad that we have adopted HTML/CSS as the universal lingua franca for describing views? I understand why (or at least I believe I do): HTML/CSS is an inevitable part of the ecosystem because the web is an important target. A lot of devs will know at least some, and your organisation may already have loads of them because you also need to target the web. Maybe you even already have some view code written…
> HTML/CSS is an inevitable part of the ecosystem because the web is an important target. You did confuse cause with effect. In the first place Web accepted HTML/CSS/JS for the good reason - as a classic implementation of "Separation of Concerns" principle. See: 1. HTML defines semantic structure of UI - DOM tree. 2. JS, as language-behind-the-UI, handles users events and updates DOM tree and its state. 3. CSS define…
The problem I have with HTML is that it's only really any good at defining the semantic structure of a document, particularly the type of thing you might produce with a word processor. Half the stuff on a modern webpage—even those you'd still call documents rather than apps—can only really convey meaning via visual layout, and so break down when divorced from CSS/JS.
For example: I'm a big fan of reader mode in browsers, but so often they're tripped up by basic UI affordances like menus and image galleries. The renderer has to guess at what's content and what isn't, so half the time any sort of "widget" is rendered as a crappy-looking vertical list. Sure, that's technically what a menu or gallery is at its most basic level, but surely we can do better?
There probably are sensible defaults you can already follow—representing a menu as a containing s, say. But it would be much easier if there was a tag. A inside a would semantically be a menu in the same way that inside is semantically an ordered list—you don't need any CSS to render that in a sensible way.
Same goes for galleries; if we had a tag that could contain and s, you'd still be able to do custom layout with CSS if you needed to, but at the base level you could sensibly render it with just the markup itself.
I dunno, I just find it weird that we added all these new tags for HTML5 years ago then just stopped bothering. I mean when was the last time a HTML element with behaviour was added?
In an ideal world a reader mode could be expanded to a "reader-friendly page mode" wherein the page still looked approximately like the normal webpage, just without all the user-hostile shit. Of course, that's usually diametrically opposed to the financial incentives of running a website, but it's nice to think about.