Your IP : 216.73.216.79


Current Path : /var/www/html/dvs/node_modules/vuesax/src/util/
Upload File :
Current File : /var/www/html/dvs/node_modules/vuesax/src/util/defineVuesaxOptions.ts

import { setColor } from './index'

export interface VuesaxOptions {
  colors?: VuesaxColors
}

export interface VuesaxColors {
  [item: string]: any
  primary: string
  success: string
  danger: string
  warn: string
  dark: string
}

const defineColors = (colors: VuesaxColors) => {
  Object.keys(colors).forEach((item) => {
    if (document.body) {
      setColor(item, colors[item], document.body)
    }
  })
}

export const defineVuesaxOptions = (options: VuesaxOptions) => {
  if (!!options.colors) {
    defineColors(options.colors)
  }
}