Skip to content

Commit

Permalink
Fixing types
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgperry committed Oct 9, 2024
1 parent 8ebc45e commit a761a3c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Framer Motion adheres to [Semantic Versioning](http://semver.org/).

Undocumented APIs should be considered internal and may change without warning.

## [11.11.5] 2024-10-09

### Fixed

- Removed ability to define CSS variables on `style` without casting, as this was conflicting with React `CSSProperties`.

## [11.11.4] 2024-10-08

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ describe("css variables", () => {
})
})

test("motion component still accetps React.CSSProperties", () => {
;() => (
<motion.div style={{ transform: "none" } as React.CSSProperties} />
)
})

test("should animate css color variables", async () => {
const promise = new Promise((resolve) => {
let frameCount = 0
Expand Down
7 changes: 5 additions & 2 deletions packages/framer-motion/src/motion/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ export type MotionCSS = MakeMotion<
*/
export type MotionTransform = MakeMotion<TransformProperties>

/**
* TODO: Currently unused, would like to reimplement with the ability
* to still accept React.CSSProperties.
*/
export type MotionCSSVariables = {
[key: `--${string}`]:
| MotionValue<number>
Expand All @@ -99,8 +103,7 @@ export type MotionCSSVariables = {
/**
* @public
*/
export type MotionStyle = MotionCSSVariables &
MotionCSS &
export type MotionStyle = MotionCSS &
MotionTransform &
MakeMotion<SVGPathProperties> &
MakeCustomValueType<CustomStyles>
Expand Down

0 comments on commit a761a3c

Please sign in to comment.