Skip to content

Commit

Permalink
fix(docs): Update recommendations in Keyframes doc
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlanjc committed Jan 17, 2022
1 parent 0431534 commit eca60a2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/docs/src/pages/guides/keyframes.mdx
Expand Up @@ -16,7 +16,7 @@ library itself. Instead, use [the `keyframes` helper from Emotion](https://emoti

<Note>

Because `@emotion/react` is a dependency of Theme UI, it’s available in your
`@emotion/react` is a peer dependency of Theme UI, so while required alongside available in your
project without manual installation. Installing it separately can cause configuration issues due to
multiple copies with conflicting versions.

Expand All @@ -35,15 +35,18 @@ const fadeIn = keyframes({ from: { opacity: 0 }, to: { opacity: 1 } })
export default (props) => (
<Box
{...props}
sx={{
animationName: fadeIn,
animationDuration: '1s',
animationFillMode: 'backwards',
}}
sx={{ animation: `${fadeIn} 1s backwards` }}
/>
)
```

<Note>

To directly set `animationName` using object syntax, append `.toString()` to the animation variable.
This workaround is not needed when using the variable inside a template string, such as above.

</Note>

Using template literal syntax:

```js
Expand Down

0 comments on commit eca60a2

Please sign in to comment.