Mixins / Inside-out composition
Why this is more than className
A className escape hatch says only "put this class on something." It does not say what that
something structurally is, which events it exposes, which attributes callers may add, or which
pieces are too important to replace.
A slot can express all of those things:
input slot
├─ capability: TextInput
├─ events: input
├─ attributes: aria-invalid
├─ protected: role
└─ hidden: falseThat means a Behavior can say "I require a text input that exposes aria-invalid" and fail at
definition time if somebody tries to attach it to an incompatible slot.
The contract also gives tooling something richer than DOM markup to inspect: a serializable list of supported customization points, capabilities, events and attributes.