diff --git a/packages/number-flow/package.json b/packages/number-flow/package.json index ae81bf7a..c56b20c7 100644 --- a/packages/number-flow/package.json +++ b/packages/number-flow/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.3.1", + "version": "0.3.2", "author": { "name": "Maxwell Barvian", "email": "max@barvian.me", diff --git a/packages/number-flow/src/index.ts b/packages/number-flow/src/index.ts index fa74264e..38da41c6 100644 --- a/packages/number-flow/src/index.ts +++ b/packages/number-flow/src/index.ts @@ -10,6 +10,7 @@ import { import { ServerSafeHTMLElement } from './ssr' import styles, { supportsMod, + supportsLinear, dxVar, opacityDeltaVar, prefersReducedMotion, @@ -23,7 +24,7 @@ import { max } from './util/math' export { SlottedTag, slottedStyles, prefersReducedMotion } from './styles' export * from './formatter' -export const canAnimate = supportsMod && supportsAtProperty +export const canAnimate = supportsMod && supportsLinear && supportsAtProperty type RawTrend = boolean | 'increasing' | 'decreasing' export { type RawTrend as Trend } diff --git a/packages/number-flow/src/styles.ts b/packages/number-flow/src/styles.ts index a8bc06d7..407513e0 100644 --- a/packages/number-flow/src/styles.ts +++ b/packages/number-flow/src/styles.ts @@ -1,6 +1,9 @@ import { BROWSER } from 'esm-env' import { css } from './util/css' +export const supportsLinear = + BROWSER && typeof CSS !== 'undefined' && CSS.supports('animation-timing-function', 'linear(1,2)') + export const supportsMod = BROWSER && typeof CSS !== 'undefined' && CSS.supports('line-height', 'mod(1,1)') diff --git a/packages/react/package.json b/packages/react/package.json index b8e55cd1..176d9ccb 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "0.2.2", + "version": "0.2.3", "author": { "name": "Maxwell Barvian", "email": "max@barvian.me",