Skip to content

Commit

Permalink
fix: adds keyframes to emotion exports (#135)
Browse files Browse the repository at this point in the history
Co-authored-by: Vincent Audebert <vaudebert@online.net>
  • Loading branch information
vincentaudebert and Vincent Audebert committed Sep 10, 2020
1 parent d8ba9f8 commit 194d442
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/emotion/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export {
ThemeContext,
Global,
ClassNames,
keyframes,
} from '@emotion/core'
export { ThemeProvider, withTheme, useTheme } from 'emotion-theming'
export * from './breakpoints'
Expand Down
23 changes: 22 additions & 1 deletion packages/emotion/src/styled.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import '@testing-library/jest-dom/extend-expect'
import { render, cleanup } from '@testing-library/react'
import { ThemeProvider } from 'emotion-theming'
import styled, { css } from '.'
import styled, { css, keyframes } from '.'

afterEach(cleanup)

Expand Down Expand Up @@ -34,6 +34,27 @@ describe('#styled', () => {
`)
})

it('works with keyframes', () => {
const animation = keyframes`
from {
transform: translateX(0%);
}
to {
transform: translateX(100%);
}
`
const Dummy = styled.div`
${css`
animation: ${animation};
`}
`

const { container } = render(<Dummy />)

expect(container.firstChild).toHaveStyle(`animation: ${animation.name};`)
})

it('reads value from the theme', () => {
const theme = {
colors: {
Expand Down
7 changes: 0 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3224,13 +3224,6 @@ browser-process-hrtime@^1.0.0:
resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626"
integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==

browser-resolve@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-2.0.0.tgz#99b7304cb392f8d73dba741bb2d7da28c6d7842b"
integrity sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==
dependencies:
resolve "^1.17.0"

browserify-aes@^1.0.0, browserify-aes@^1.0.4:
version "1.2.0"
resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48"
Expand Down

0 comments on commit 194d442

Please sign in to comment.