by nidificate · 7y ago · 0 comments
https://html.spec.whatwg.org/multipage/custom-elements.html#...
https://github.com/w3c/webcomponents/
https://developer.mozilla.org/en-US/docs/Web/Web_Components/...
I wrote this code in another comment, but imagine if you could hook functionality to an element via defined attributes. With custom elements, you have to add the functionality via a script, and they aren't system functions (from what I can remember, I may be wrong).
<LabelList list>
<LabelItem label listItem>
</LabelItem>
</LabelList>
In the above code:- the LabelList element hooks into the systems "list" behavior
- the LabelItem element hooks into the systems "label" behavior
- the LabelItem element hooks into the systems "listItem" behavior
<ul is="label-list">
<li is="list-item">foo</li>
</ul>
EDIT: google's documentation: https://developers.google.com/web/fundamentals/web-component...