export const hoverableMixin = (superclass) =>
  class HoverableMixinClass extends superclass {
    init() {
      super.init?.();

      (this.baseElement || this).addEventListener('mouseover', (e) => {
        this.setAttribute('hover', 'true');
        e.target.addEventListener('mouseleave', () => this.removeAttribute('hover'), {
          once: true,
        });
      });
    }
  };
