Post

Still writing DIV-soup? ANY tagname with a dash becomes a valid HTMLElement, NOT HTMLUnknownElement as some gurus claim. That means you can replace ALL DIVs with semantic HTML. Absolutely NO JavaScript required, only HTML and CSS! Should we call them "Web Components"? You tell me #webcomponents

0 reposts5 likes

Interesting! I canโ€™t tell if itโ€™a brilliant or mad. One downside might be naming conflicts when importing web components and that might be hard to debug. But, I like using less divs

> naming conflicts when importing web components That is an "issue" with ALL Web Components, and why ๐™Ž๐™˜๐™ค๐™ฅ๐™š๐™™ ๐˜พ๐™ช๐™จ๐™ฉ๐™ค๐™ข ๐™€๐™ก๐™š๐™ข๐™š๐™ฃ๐™ฉ ๐™๐™š๐™œ๐™ž๐™จ๐™ฉ๐™ง๐™ž๐™š๐™จ are on the horizon The author defining a <๐™ข๐™ฎ-๐™˜๐™ค๐™ข๐™ฅ๐™ค๐™ฃ๐™š๐™ฃ๐™ฉ> WITH JavaScript *first* is in control, NON-defined Components will be overwritten. Later defines will fail.

Good to know: โ–บ You have to set ๐™™๐™ž๐™จ๐™ฅ๐™ก๐™–๐™ฎ: ๐™—๐™ก๐™ค๐™˜๐™  / ๐™ž๐™ฃ๐™ก๐™ž๐™ฃ๐™š-๐™—๐™ก๐™ค๐™˜๐™ ; yourself โ–บ CSS :๐™™๐™š๐™›๐™ž๐™ฃ๐™š๐™™ targets JavaScript defined Custom Elements โ–บ Thus CSS :๐™ฃ๐™ค๐™ฉ(:๐™™๐™š๐™›๐™ž๐™ฃ๐™š๐™™) targets the ๐™ช๐™ฃ๐™™๐™š๐™›๐™ž๐™ฃ๐™š๐™™ elements they are still valid HTMLElements, CSS applies like any element