-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
babel-make-styles: Correctly handling sequence expressions (#21010)
* babel-make-styles: Correctly handling sequence expressions. * Change files * Update packages/babel-make-styles/src/plugin.ts Co-authored-by: Oleksandr Fediashov <[email protected]> Co-authored-by: Oleksandr Fediashov <[email protected]>
- Loading branch information
1 parent
bd40a6e
commit 9498e23
Showing
4 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-babel-make-styles-640822ac-aebd-493a-8831-79760610f65b.json
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 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "babel-make-styles: Correctly handling sequence expressions.", | ||
"packageName": "@fluentui/babel-make-styles", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
15 changes: 15 additions & 0 deletions
15
packages/babel-make-styles/__fixtures__/object-sequence-expr/code.ts
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,15 @@ | ||
import { makeStyles, MakeStylesStyle } from '@fluentui/react-make-styles'; | ||
|
||
const switchClassName = 'fui-Switch'; | ||
let _a: Record<string, MakeStylesStyle>; | ||
|
||
export const useStyles = makeStyles({ | ||
root: | ||
((_a = {}), | ||
(_a[':hover .' + switchClassName] = { | ||
':before': { | ||
backgroundColor: 'red', | ||
}, | ||
}), | ||
_a), | ||
}); |
15 changes: 15 additions & 0 deletions
15
packages/babel-make-styles/__fixtures__/object-sequence-expr/output.ts
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,15 @@ | ||
import { __styles, MakeStylesStyle } from '@fluentui/react-make-styles'; | ||
const switchClassName = 'fui-Switch'; | ||
|
||
let _a: Record<string, MakeStylesStyle>; | ||
|
||
export const useStyles = __styles( | ||
{ | ||
root: { | ||
ozcac4: 'f1cm6cy7', | ||
}, | ||
}, | ||
{ | ||
h: ['.f1cm6cy7:hover .fui-Switch:before{background-color:red;}'], | ||
}, | ||
); |
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