Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): Update recommendations in Keyframes doc #2079

Merged
merged 2 commits into from Jan 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 10 additions & 8 deletions packages/docs/src/pages/guides/keyframes.mdx
Expand Up @@ -16,9 +16,8 @@ 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
project without manual installation. Installing it separately can cause configuration issues due to
multiple copies with conflicting versions.
`@emotion/react` is a peer dependency of Theme UI, so while required alongside Theme UI packages,
it needs manual installation in your project.

</Note>

Expand All @@ -35,15 +34,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