Skip to content

Commit 194d442

Browse files
vincentaudebertVincent Audebert
andauthored
fix: adds keyframes to emotion exports (#135)
Co-authored-by: Vincent Audebert <[email protected]>
1 parent d8ba9f8 commit 194d442

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

packages/emotion/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export {
1111
ThemeContext,
1212
Global,
1313
ClassNames,
14+
keyframes,
1415
} from '@emotion/core'
1516
export { ThemeProvider, withTheme, useTheme } from 'emotion-theming'
1617
export * from './breakpoints'

packages/emotion/src/styled.test.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react'
22
import '@testing-library/jest-dom/extend-expect'
33
import { render, cleanup } from '@testing-library/react'
44
import { ThemeProvider } from 'emotion-theming'
5-
import styled, { css } from '.'
5+
import styled, { css, keyframes } from '.'
66

77
afterEach(cleanup)
88

@@ -34,6 +34,27 @@ describe('#styled', () => {
3434
`)
3535
})
3636

37+
it('works with keyframes', () => {
38+
const animation = keyframes`
39+
from {
40+
transform: translateX(0%);
41+
}
42+
43+
to {
44+
transform: translateX(100%);
45+
}
46+
`
47+
const Dummy = styled.div`
48+
${css`
49+
animation: ${animation};
50+
`}
51+
`
52+
53+
const { container } = render(<Dummy />)
54+
55+
expect(container.firstChild).toHaveStyle(`animation: ${animation.name};`)
56+
})
57+
3758
it('reads value from the theme', () => {
3859
const theme = {
3960
colors: {

yarn.lock

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3224,13 +3224,6 @@ browser-process-hrtime@^1.0.0:
32243224
resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626"
32253225
integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==
32263226

3227-
browser-resolve@^2.0.0:
3228-
version "2.0.0"
3229-
resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-2.0.0.tgz#99b7304cb392f8d73dba741bb2d7da28c6d7842b"
3230-
integrity sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==
3231-
dependencies:
3232-
resolve "^1.17.0"
3233-
32343227
browserify-aes@^1.0.0, browserify-aes@^1.0.4:
32353228
version "1.2.0"
32363229
resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48"

0 commit comments

Comments
 (0)