3 ms·
Yep, to some degree. Though what I would love in an xml-based UI description language is the ability to opt into default system behaviors, while maintaining the
by tenaciousDaniel 7y ago
Yep, to some degree. Though what I would love in an xml-based UI description language is the ability to opt into default system behaviors, while maintaining the ability to use whatever semantic naming convention that fits my application.
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
- warp 7y agoMaybe the is="" attribute gets you partway there? <ul is="label-list"> <li is="list-item">foo</li> </ul> EDIT: google's documentation: https://developers.google.com/web/fundamentals/web-components/customelements#extendhtml https://developers.google.com/web/fundamentals/web-component...