News for hackers. Stuff that matters.
Re:Writing HTML by Hand by err4nt on Wednesday September 20, 2023 @12:33AM (#37580404)
I write HTML by hand and one thing that's come in handy is HTML's built-in functionality for author-defined custom elements. We use ICON-LIST which wraps a UL and optionally an SVG if you don't want to use the default checkmark, and STAR-RATING which displays a rating out of 5 SVG stars. They aren't my most-used, that's probably P or A or LI or DIV or SPAN by number, but they're some of the most important I use frequently!
Re:Writing HTML by Hand by semanticc on Wednesday September 20, 2023 @03:25AM (#37581390)
Are you talking about web components?
Re:Writing HTML by Hand by tannhaeuser on Wednesday September 20, 2023 @03:58AM (#37581619)
Was wondering as well. You can just go ahead and use your own element straight away. You just won't get tag omission and other short forms, but you aren't getting those by using the questionable JS API for declaring elements (or proposed new APIs for HTML fragment parsing in browsers) either.

The use case mentioned - custom list bullets - can be implemented using CSS btw [1]. Not that I'd advocate for it; like all things CSS, it involves lookup of obscure and rare custom syntax, questionable layering a la "content:", suggestion of orthogonality that isn't really there, and browser support troubles.

[1]: https://web.dev/css-marker-pseudo-element/

Re:Writing HTML by Hand by Vinnl on Wednesday September 20, 2023 @05:48AM (#37582295)
Web Components are generally considered to be a set of standards, and Custom Elements is one of them. The others are Shadow DOM and HTML Templates (the <template> element).