Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

438 B
Raw Blame
export interface OverlayRoot {
  host: HTMLElement;
  shadow: ShadowRoot;
}

export function createOverlayRoot(styles: string, tag = 'div'): OverlayRoot {
  const host = document.createElement(tag);
  host.setAttribute('data-mimik-ignore', '');
  const shadow = host.attachShadow({ mode: 'closed' });
  const style = document.createElement('style');
  style.textContent = styles;
  shadow.appendChild(style);
  return { host, shadow };
}