3 ms·
Arguably, that would be misuse of the semantic meaning of "section." While <section> is nearly as generic as <div>, they should always have a heading of their o
by Kerrick 9mo ago
Arguably, that would be misuse of the semantic meaning of "section." While <section> is nearly as generic as <div>, they should always have a heading of their own. The author's <swim-lane> already has a nested <section> with its own <h2>, but the <swim-lane> itself doesn't get (or need) its own even-higher heading.
And since that would drive us to <div>, I don't see any value in <div class="swim-lanes"> over <swim-lanes>.
- akst 9mo agoWeb components come with additional complexity, heavy use of custom element definitions are more complicated to manage. It’s more than just an aesthetic preference But if you’re not really using web components it’s harmless but it’s a bit odd and pointless.
- Kerrick 9mo agoHTML had custom elements before Web Components (the complex modern JavaScript & Shadow DOM thing) came into being. https://www.w3.org/TR/2016/WD-custom-elements-20160523/ https://www.w3.org/TR/2016/WD-custom-elements-20160523/
- akst 9mo agoIn case you’ve forgotten this is a thread on an article about web components. If the underlying premise of your point was entirely independent of web components you’ve done pretty poor job of communicating it. So you actually do that? Use custom elements without web components instead of using classes? Are you using in something like react with custom elements foregoing type safety to avoid a div element? Or is this just in plain HTML? How many custom elements does your typical web project have? Or are you fixating on an irrelevant technicality to make an irrelevant point?
- Kerrick 9mo ago...? The article is literally about not using web components. FTA: > What would happen if we took the ideas of HTML Web Components and skipped all the JavaScript? [...] Okay great, we styled some HTML nested inside a custom element.
- akst 9mo agoFeel free to reread the article title. Let’s not pretend like your original point here was they were barely using features of web components correctly, like the parent of this thread was clearly implying.
- strogonoff 9mo agoIt is unfortunate that you cannot simply move a block of HTML elsewhere where the context is otherwise perfectly suitable but expected heading level is different[0]. Section-relative headings were briefly part of the spec but quickly got removed. As it stands, I would not consider any block of HTML with an <hX> element portable. [0] https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/Heading_Elements#avoid_using_multiple_h1_elements_on_one_page https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...