Builder.io Docs Inverted Fullscreen Colors in Dark Mode

Problem:
Videos, images, and iframes embedded in documentation (example) are re-inverted when dark mode is active, so the colors appear correct, but not when fullscreening the element. I’m using latest Chromium.

Solution:
Listen for fullscreen change event on appropriate elements and toggle dark-mode on the tag accordingly.

document.querySelectorAll('.dark-mode :is(img, video, iframe)')
  .onfullscreenchange = e => { 
    if(e.target === document.fullscreenElement) 
      document.querySelector('html').classList.remove('dark-mode'); 
    else 
      document.querySelector('html').classList.add('dark-mode'); 
  };