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
Full TypeScript signature sourced from the composable file.
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
Return values
Properties and methods exposed by the composable return object.
- 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
Examples
Ready-to-paste usage snippets.
Branch on container query support
Free-form query with supportsAny
Hydration-safe markup gate (useCssSupportClient)