-
-
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 appending manual labels to Babel-optimized style objects (#2335)
* fix #2311 to support custom label regex match logic * test: add @emotion/babel-plugin unit test and fix code style * use Andarist's alternative fix * Update .changeset/famous-papayas-roll.md Co-authored-by: Mitchell Hamilton <[email protected]> Co-authored-by: Mateusz BurzyΕski <[email protected]>
- Loading branch information
1 parent
36a51c2
commit 662f0e0
Showing
4 changed files
with
81 additions
and
1 deletion.
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,5 @@ | ||
--- | ||
'@emotion/serialize': patch | ||
--- | ||
|
||
Fixed appending manual labels to Babel-optimized style objects. |
20 changes: 20 additions & 0 deletions
20
packages/babel-plugin/__tests__/__fixtures__/autolabel-and-css-property-label.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,20 @@ | ||
/** @jsx jsx */ | ||
import { jsx, css } from '@emotion/react' | ||
|
||
const SomeComponent = () => ( | ||
<div | ||
className={css` | ||
color: pink; | ||
label: iChenLei; | ||
`} | ||
/> | ||
) | ||
|
||
const OtherComponent = () => ( | ||
<div | ||
className={css({ | ||
color: 'blue', | ||
label: 'iChenLei' | ||
})} | ||
/> | ||
) |
55 changes: 55 additions & 0 deletions
55
packages/babel-plugin/__tests__/__snapshots__/index.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
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