// the window's top and bottom stick to the viewport, so whatever sizes itself to the space
// between them (the lists, the paper) needs their heights

const root = document.documentElement.style;
const watch = (el: HTMLElement | null, name: string) => {
  if (!el) return;
  new ResizeObserver(() => root.setProperty(name, `${el.offsetHeight}px`)).observe(el);
};
watch(document.querySelector("[data-head]"), "--head-h");
watch(document.querySelector("[data-foot]"), "--foot-h");

export {};
