vuestic-ui
Version:
Vue 3 UI Framework
1 lines • 744 B
Source Map (JSON)
{"version":3,"file":"useCSSVariables.mjs","sources":["../../../../src/composables/useCSSVariables.ts"],"sourcesContent":["import { computed } from 'vue'\nimport { camelCaseToKebabCase } from '../utils/text-case'\n\nexport const useCSSVariables = (prefix: string, cb: () => Record<string, string>) => {\n return computed(() => Object.entries(cb()).reduce((acc, [key, value]) => {\n acc[`--${prefix}-${camelCaseToKebabCase(key)}`] = value\n return acc\n }, {} as Record<string, string>))\n}\n"],"names":[],"mappings":";;AAGa,MAAA,kBAAkB,CAAC,QAAgB,OAAqC;AACnF,SAAO,SAAS,MAAM,OAAO,QAAQ,GAAI,CAAA,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM;AACvE,QAAI,KAAK,MAAM,IAAI,qBAAqB,GAAG,CAAC,EAAE,IAAI;AAC3C,WAAA;AAAA,EAAA,GACN,CAAA,CAA4B,CAAC;AAClC;"}