Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply VueUse composables in Vue 3/Nuxt projects to replace custom implementations with battle-tested utilities.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/usePreferredContrast.md
1---2category: Browser3---45# usePreferredContrast67Reactive [prefers-contrast](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-contrast) media query.89## Usage1011```ts12import { usePreferredContrast } from '@vueuse/core'1314const preferredContrast = usePreferredContrast()15```1617## Component Usage1819```vue20<template>21<UsePreferredContrast v-slot="{ contrast }">22Preferred Contrast: {{ contrast }}23</UsePreferredContrast>24</template>25```2627## Type Declarations2829```ts30export type ContrastType = "more" | "less" | "custom" | "no-preference"31/**32* Reactive prefers-contrast media query.33*34* @see https://vueuse.org/usePreferredContrast35* @param [options]36*37* @__NO_SIDE_EFFECTS__38*/39export declare function usePreferredContrast(40options?: ConfigurableWindow,41): ComputedRef<ContrastType>42```43