News for hackers. Stuff that matters.
Re:Declarative Shadow DOM by DaiPlusPlus on Friday October 02, 2020 @03:37AM (#24660057)
> The current JS requirement is a drag

HTML could be so much more useful and time-saving if more functionality could be built without JavaScript.

Thanks to CSS tricks, such as using the `:checked` pseudo-class in invisible form elements (toggled with a visible `<label for="">` I can implement neat show/hide effects in websites without any script - my current server-side-rendered project has a reusable "tab control" that doesn't use any client-script at all. It's great because it will always just-work, even if the user has weird privacy/script settings.

I can distill what I want down to two simple things: I want more CSS pseudo-classes based on the live DOM state (and the ability to add arbitrary wrapper boxes around or inside any element) and more native HTML elements that can mutate the DOM without requiring any scripts.

Re:Declarative Shadow DOM by ksec on Friday October 02, 2020 @11:35AM (#24663693)
>HTML could be so much more useful and time-saving if more functionality could be built without JavaScript.

I wish there is a movement for this. But unfortunately the Web Standard today is pretty much dedicated by Google. ( Although Apple and Mozilla still has some leverage )

Re:Declarative Shadow DOM by ZephyrBlu on Friday October 02, 2020 @04:41AM (#24660466)
It works, but that feels like you're hijacking HTML/CSS for an unintended use case.
Re:Declarative Shadow DOM by DaiPlusPlus on Friday October 02, 2020 @05:43AM (#24660783)
The web today: as a platform for user interfaces and general-purpose content display, is far, far removed from HTML's "intended use case" as a means of sharing simple documents.

Like it or not, but HTML+CSS is being used for all kinds of UI - and right now you absolutely need JS to support state-transitions in HTML, even if those states arguably shouldn't need any script because the same logic can be expressed without using a Turing-complete programming language.