The badge on something is a good example for using absolute positioning exactly for what it's meant for imho.
With "canvas-like approach", I meant this part of your comment (not the web technology):
> Basically, my assertion used to be to draw out what you have in mind on grid paper.
I guess we were talking past each other because you equate templates and designs, and I didn't think of this usage of the term (the post also is not about this).
Templating is not necessarily for full pages always, that defeats the purpose of templating languages in the first place to me.
> Direct to my claim, though; my argument is just that templates/designs are visual things. I don't think people are thinking in terms of nested div elements.
Agree. And using modern CSS is a great way to reduce the number of "div"s.
> But I am curious on why so many nested divs seem to be needed all of the time.
I fought many these battles in my jobs, and often it's just for flexibility, because different components are written in a modular fashion. Minimizing the DOM tree size is my goal too, but often the version with less nesting requires a bit more thinking and breaks more easily when elements are added or changed.
CSS gris vs nesting flex containers is a great example for that.
Other times it's just laziness / people don't care.
Another poster was pointing out that this is not necessarily what is meant by templates in the post. I can see the distinction, but not really sure it changes my view. Since the post is largely more javascript literals for dom objects, it is hard for me not to bring that back to the design implications? Literally comes back to "people love JSX" many times. Why? Because it lets them get things to the presentation layer that is their browser.
I took some time to dive into how extensive JavaScript has made the word template in their world. I confess it reads a bit excessive to me. More than a bit, really. Tagged templates, in particular, look like one of the biggest foot guns I've ever seen.
I took it to design because I don't know of any other real reason to template the DOM other than for design purposes. Indeed, reading on the linked proposal, this is to make reactive things on a page. And that will have to be married to a design at some point. Often the entire point of introducing names that are exported from data to a rendered document is for the presentation implications of it. Otherwise, you'd just output the data?