import { useColorSchemeStore } from '@/stores/color-scheme'
import { useDarkModeStore } from '@/stores/dark-mode'

export function applyColorSchemeClass() {
  const el = document.documentElement
  el.setAttribute('data-theme', useColorSchemeStore().colorSchemeValue)
  if (useDarkModeStore().darkModeValue) {
    el.classList.add('dark')
  }
}

export function applyDarkModeClass() {
  const el = document.documentElement
  if (useDarkModeStore().darkModeValue) {
    el.classList.add('dark')
  } else {
    el.classList.remove('dark')
  }
}

export function applyAppearance() {
  applyColorSchemeClass()
  applyDarkModeClass()
}
