I think the second linked article required an "edge function" to add the data- attribute to the HTML delivered to the client, and I think TFA's author doesn't like the need for that (i.e., wants to deliver a static document), but I think you could do it with some synchronous Javascript; the fallback for clients not wanting JS would be CSS media queries that just obeyed the UA's preferences… which seems like exactly what one should want…?
(So, I'm also missing a convincing "why", here.)
I don't think it completely solves it, but it would be useful to be able to apply styling to a specific part of the page ie: highlight something so when you send it, it saves the receiver a little time searching for it.
Or in a similar vein, wouldn't it be cool to make any header an anchor? So I could say,
http://example.com/article.html#second_header
or whatever. Not the same concept, but it would be useful.
Gemini clients still keep that dream alive, although there's plenty of disagreement as to exactly how it should function: https://gitlab.com/gemini-specification/gemini-text/-/issues...
You already can make any header an anchor, right?
eg: <h2 id="second_header">Second Header</h2>
There... shouldn't be? I'm kind of missing the part that explains why you'd need this? Are there any concrete examples where "I need the headers and/or URL" lets you do something that you can't already do by making sure your document has the information it needs, in the document itself? (if you need URL-specific CSS, you just... load more CSS...? You template in the necessary <link> elements because your server knows which URL is being requested?)