5 comments

[ 2.8 ms ] story [ 25.6 ms ] thread
I wish CSS selector based templating existed as a popular practice. Something like:

    a#products { --text: name_of_my_variable; --attr-href: other_variable; }
    ul { --list: iterate(my_list_variable); }
    ul li { --text: item().name; }
I want something that allows my HTML template to be pure HTML. No template {vars}, no weird attributes, no language tags, etc. Just let me use plain HTML and target its DOM externally. XSLT can do that, but it feels like it wasn't meant to be written by humans.
What I would like to see: client-side template ability to insert a chunk of DOM nodes into the page from a URL, without having to invoke Javascript.

You can insert an image, a video, a SVG, or even an iframe from a URL, but you can't insert a <div>.

You basically want the functionality of https://htmx.org/ but without the added JS.

This would definitely be very nice to see -- but somehow I don't see browsers moving in that direction.