api-docs
api-docs copied to clipboard
Recommend augmenting csstype instead of casting to `any`
Currently, the docs recommend just casting to any
whenever using CSS variables in TypeScript, but you don't have to do that. If you use module augmentation instead, you still get the benefits of typechecking, including on your CSS variables!
And here's a CodeSandbox to prove that it works: https://codesandbox.io/s/framer-motion-csstype-augmentation-shmjq
Note how it correctly flags the misspelled CSS variable:

@cpmsmith is attempting to deploy a commit to the Framer Team on Vercel.
A member of the Team first needs to authorize it.