Skip to content

usePreferredReducedTransparency

Category
Export Size
1.22 kB
Last Changed
4 days ago

Reactive prefers-reduced-transparency media query.

Demo

Preferred Transparency:
no-preference

Usage

ts
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

ts
export type 
ReducedTransparencyType
= "reduce" | "no-preference"
/** * Reactive prefers-reduced-transparency media query. * * @see https://vueuse.org/usePreferredReducedTransparency * @param [options] * * @__NO_SIDE_EFFECTS__ */ export declare function
usePreferredReducedTransparency
(
options
?:
ConfigurableWindow
,
):
ComputedRef
<
ReducedTransparencyType
>

Source

SourceDemoDocs

Contributors

NoiseFan

Changelog

No recent changes

Released under the MIT License.