bootstrap-vue-next
Version:
Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development
1 lines • 1.07 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/composables/useColorMode/index.ts"],"sourcesContent":["import {type UseColorModeOptions, useColorMode as useVueuseColorMode} from '@vueuse/core'\n\nexport interface ColorModeOptions extends UseColorModeOptions {\n /**\n * When set to true, useColorMode will automatically store itself and persist (default localstorage).\n * @default false\n */\n persist?: boolean\n}\n\nexport const useColorMode = (opts: Readonly<ColorModeOptions> = {}) => {\n const persist = opts.persist ?? false\n const attribute = 'data-bs-theme'\n const selector = 'html'\n return useVueuseColorMode({\n attribute,\n selector,\n storageKey:\n persist === true\n ? `bv-color-${opts.attribute ?? attribute}-${opts.selector ?? selector}`\n : null,\n ...opts,\n })\n}\n"],"mappings":";;AAUA,IAAa,gBAAgB,OAAmC,EAAE,KAAK;CACrE,MAAM,UAAU,KAAK,WAAW;CAChC,MAAM,YAAY;CAClB,MAAM,WAAW;AACjB,QAAO,eAAmB;EACxB;EACA;EACA,YACE,YAAY,OACR,YAAY,KAAK,aAAa,UAAU,GAAG,KAAK,YAAY,aAC5D;EACN,GAAG;EACJ,CAAC"}