usePreferredReducedTransparency ​
Reactive prefers-reduced-transparency media query.
Demo ​
Usage ​
js
import { usePreferredReducedTransparency } from '@vueuse/core'
const preferredTransparency = usePreferredReducedTransparency()
Component Usage ​
This function also provides a renderless component version via the
@vueuse/components
package. Learn more about the usage.
vue
<template>
<UsePreferredReducedTransparency v-slot="{ transparency }">
Preferred Reduced transparency: {{ transparency }}
</UsePreferredReducedTransparency>
</template>
Type Declarations ​
typescript
export type ReducedTransparencyType = "reduce" | "no-preference"
/**
* Reactive prefers-reduced-transparency media query.
*
* @see https://vueuse.org/usePreferredReducedTransparency
* @param [options]
*/
export declare function usePreferredReducedTransparency(
options?: ConfigurableWindow,
): ComputedRef<ReducedTransparencyType>
Source ​
Contributors ​
huiliangShen
Changelog ​
v12.2.0-beta.1
on 12/23/2024