Is there any way to reliably attach attribute-based behavior to custom elements by default? There are two cases I'm thinking of:
- Wanting to have a host element automatically apply layout attributes to itself
- Wanting to add touch-action on a host element by default
In the former case, I know that I can do the CSS manually (but it'd be nice not to have to) but I'm not sure how to accomplish the latter case short of actually adding the attribute during the created callback, but that pollutes the DOM a bit. I'm working around it for now by having an inner container, but I'd prefer not to have to do that.
Any "right way" to do this?