Skip to content

Commit

Permalink
Add linear() support check for #31
Browse files Browse the repository at this point in the history
  • Loading branch information
barvian committed Oct 21, 2024
1 parent 366217d commit 8e8bc83
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/number-flow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "0.3.1",
"version": "0.3.2",
"author": {
"name": "Maxwell Barvian",
"email": "[email protected]",
Expand Down
3 changes: 2 additions & 1 deletion packages/number-flow/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import { ServerSafeHTMLElement } from './ssr'
import styles, {
supportsMod,
supportsLinear,
dxVar,
opacityDeltaVar,
prefersReducedMotion,
Expand All @@ -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 }
Expand Down
3 changes: 3 additions & 0 deletions packages/number-flow/src/styles.ts
Original file line number Diff line number Diff line change
@@ -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)')

Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "0.2.2",
"version": "0.2.3",
"author": {
"name": "Maxwell Barvian",
"email": "[email protected]",
Expand Down

0 comments on commit 8e8bc83

Please sign in to comment.