useCssSupport

CssSupport
stable

The single CSS feature-detection layer in Origam. Provides a reactive flag map for the monitored feature matrix, plus free-form supports() / supportsAny() / supportsAll() helpers with per-query caching. Never call CSS.supports() directly in a component.

API

Signature

Signature TypeScript complète extraite du fichier du composable.

typescript

All feature flags are false during SSR. Wrap markup branches on these flags with <ClientOnly> or use useCssSupportClient() which starts at the given defaultValue and only flips inside onMounted — preventing Vue hydration mismatches.

API

Valeurs de retour

Propriétés et méthodes exposées par l'objet retourné par le composable.

css
Reactive map of every feature in FEATURE_QUERIES to a boolean. All values are false during SSR; they flip to the real result on the first browser-side initialisation call.
supports
Free-form CSS.supports() wrapper with per-query caching. Accepts any string form CSS.supports() accepts (property, selector(), math, etc.).
supportsAny
Returns true if at least one of the provided queries is supported.
supportsAll
Returns true only if every provided query is supported.
has
Returns a reactive ComputedRef<boolean> for a named feature from FEATURE_QUERIES. Preferred over css.value.X when the flag drives reactive template logic.

Usage

Exemples

Extraits de code prêts à coller.

Branch on container query support

vue

Free-form query with supportsAny

vue

Hydration-safe markup gate (useCssSupportClient)

vue