-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed an issue with styles containing a trailing css variable not bei…
…ng inserted correctly where the styled were optimized by our Babel plugin to a static opaque object
- Loading branch information
Showing
11 changed files
with
931 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@emotion/cache': patch | ||
'@emotion/react': patch | ||
'@emotion/styled': patch | ||
--- | ||
|
||
Fixed an issue with styles containing a trailing css variable not being inserted correctly where the styled were optimized by our Babel plugin to a static opaque object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/react/__tests__/babel/__snapshots__/no-extra-babel-generated-content.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`should insert opaque style object with trailing css variable 1`] = ` | ||
.emotion-0 { | ||
color: hotpink; | ||
--some-variable: 16px; | ||
} | ||
<div | ||
className="emotion-0" | ||
> | ||
Text | ||
</div> | ||
`; |
23 changes: 23 additions & 0 deletions
23
packages/react/__tests__/babel/no-extra-babel-generated-content.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** @jsx jsx */ | ||
/** @emotion/babel-plugin "autoLabel": "never" */ | ||
/** @emotion/babel-plugin "sourceMap": false */ | ||
|
||
import 'test-utils/next-env' | ||
import { jsx, css } from '@emotion/react' | ||
import renderer from 'react-test-renderer' | ||
|
||
test('should insert opaque style object with trailing css variable', () => { | ||
// styles here are simple enough so they are transformed by Babel to the opaque style with {name, styles} shape | ||
const tree = renderer.create( | ||
<div | ||
css={css` | ||
color: hotpink; | ||
--some-variable: 16px; | ||
`} | ||
> | ||
Text | ||
</div> | ||
) | ||
|
||
expect(tree.toJSON()).toMatchSnapshot() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.