// 注册主题
import { TAILWIND_ROOT } from '@wakeapp/theme';
import { objectToCSSVariables, getDefaultTheme } from '@wakeapp/components';

const doc = document.documentElement;
doc.classList.add(TAILWIND_ROOT);
const theme = objectToCSSVariables(getDefaultTheme());
const head = document.head;
const style = document.createElement('style');
style.textContent = `
  :root {
    ${Object.keys(theme)
      .map(k => `${k}: ${theme[k]};`)
      .join('\n')}
  }
`;

head.appendChild(style);
