let el: HTMLStyleElement | null = null;

export function toggle(on: boolean): void {
  if (on) {
    el = document.createElement('style');
    el.id = 'accessmate-grayscale';
    el.textContent = 'html{filter:grayscale(100%)!important}';
    document.head.appendChild(el);
  } else {
    el?.remove();
    el = null;
  }
}
