useCssVar
Manipulate CSS variables
Demo
Usage
import { useCssVar } from '@vueuse/core'
const el = ref(null)
const color = useCssVar('--color', el)
const elv = ref(null)
const key = ref('--color')
const colorVal = useCssVar(key, elv)
import { useCssVar } from '@vueuse/core'
const el = ref(null)
const color = useCssVar('--color', el)
const elv = ref(null)
const key = ref('--color')
const colorVal = useCssVar(key, elv)
Type Declarations
/**
* Manipulate CSS variables.
*
* @see https://vueuse.org/useCssVar
* @param prop
* @param el
* @param options
*/
export declare function useCssVar(
prop: MaybeRef<string>,
target?: MaybeElementRef,
{ window }?: ConfigurableWindow
): Ref<string>
/**
* Manipulate CSS variables.
*
* @see https://vueuse.org/useCssVar
* @param prop
* @param el
* @param options
*/
export declare function useCssVar(
prop: MaybeRef<string>,
target?: MaybeElementRef,
{ window }?: ConfigurableWindow
): Ref<string>
Source
Contributors
Anthony Fu
Antério Vieira
btea
Alex Kozack