ensureStyles function

Last updated: 2026-02-24T19:46:21.782Z

Metrics

LOC: 30 Complexity: 2 Params: 0

Signature

ensureStyles(): : void

Source Code

function ensureStyles(): void {
  if (document.getElementById(STYLE_ID)) return;

  const style = document.createElement("style");
  style.id = STYLE_ID;
  style.textContent = `
    [${BADGE_ATTR}] {
      position: fixed;
      z-index: 2147483645;
      font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
      font-size: 9px;
      font-weight: 700;
      line-height: 1;
      padding: 2px 5px 3px;
      border-radius: 3px;
      color: #fff;
      pointer-events: none;
      white-space: nowrap;
      opacity: 0;
      transition: opacity 0.15s ease;
      box-shadow: 0 1px 4px rgba(0,0,0,0.3);
      letter-spacing: 0.3px;
      text-transform: uppercase;
    }
    [${BADGE_ATTR}].fa-badge-in] {
      opacity: 1;
    }
  `;
  document.head.appendChild(style);
}

No outgoing dependencies.

No incoming dependencies.