Skip to content

useCssSupports

Category
Export Size
Last Changed
last month

SSR compatible and reactive CSS.supports.

Demo

useCssSupports("display: flex"): true
useCssSupports("container-type", "scroll-state"): true

Usage

ts
import { 
useCssSupports
} from '@vueuse/core'
const {
isSupported
} =
useCssSupports
('container-type', 'scroll-state')

Type Declarations

ts
export interface UseCssSupportsOptions extends ConfigurableWindow {
  
ssrValue
?: boolean
} export interface UseCssSupportsReturn extends Supportable {} export declare function
useCssSupports
(
property
:
MaybeRefOrGetter
<string>,
value
:
MaybeRefOrGetter
<string>,
options
?: UseCssSupportsOptions,
): UseCssSupportsReturn export declare function
useCssSupports
(
conditionText
:
MaybeRefOrGetter
<string>,
options
?: UseCssSupportsOptions,
): UseCssSupportsReturn

Source

SourceDemoDocs

Contributors

Daniel Roe
Vida Xie
Robin

Changelog

Pending for release...
76b0b - fix(core): always return ssrValue in useCssSupports before mounted (#5290)
v14.2.0 on
c1282 - feat: add useCssSupports (#5266)

Released under the MIT License.

40% Off  yearly access to Vue School, Full course library + Vue.js Master Class.
Claim Offer