import { isRef } from 'vue';
import { tryOnMounted, tryOnUnmounted } from '@vueuse/core';

function usePageHtmlClass(classNames) {
  const addHtmlClasses = () => {
    const names = isRef(classNames) ? classNames.value : classNames;
    if (names.length > 0) {
      document?.documentElement?.classList.add(...names);
    }
  };
  const removeHtmlClasses = () => {
    const names = isRef(classNames) ? classNames.value : classNames;
    if (names.length > 0) {
      document?.documentElement?.classList.remove(...names);
    }
  };
  tryOnMounted(() => {
    addHtmlClasses();
  });
  tryOnUnmounted(() => {
    removeHtmlClasses();
  });
}

export { usePageHtmlClass };
//# sourceMappingURL=index.mjs.map
