4 ms·
> there can be information critical to styling a webpage that lives outside of the HTML alone There... shouldn't be? I'm kind of missing the part that explains
by TheRealPomax 4y ago
> there can be information critical to styling a webpage that lives outside of the HTML alone
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?)
- theandrewbailey 4y agoAgreed. I don't understand why CSS should know the page's URL. Today, one can use a bit of JS to figure out the page's URL, and use it to add a class to <html> or <body>.
- deathanatos 4y agoIt seems like the "FART" problem is sort-of driving it, but the second URL contains a rough solution to it that doesn't require the (IMO crazy) idea in the main article. 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.)
- justinator 4y agoI'm kind of missing the part that explains why you'd need this? 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 http://example.com/article.html#second_header or whatever. Not the same concept, but it would be useful.
- slondr 4y agoThere's really nothing stopping a UA from doing this, and in bygone eras "document trees" used to be part of browser UIs. 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/3 https://gitlab.com/gemini-specification/gemini-text/-/issues...
- hayyyyydos 4y ago> Or in a similar vein, wouldn't it be cool to make any header an anchor? So I could say, You already can make any header an anchor, right? eg: <h2 id="second_header">Second Header</h2>
- cryptonector 4y agoAlso, letting the page see all of the response is a bad idea, security-wise.