-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(css/modules): aggregate class names when composes is chained.
- Loading branch information
Showing
7 changed files
with
141 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
3 changes: 3 additions & 0 deletions
3
crates/swc_css_modules/tests/fixture/modules/issue-7737/issue-7737.compiled.css
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,3 @@ | ||
.__local__chain2 {} | ||
.__local__chain1 {} | ||
.__local__root-class {} |
16 changes: 16 additions & 0 deletions
16
crates/swc_css_modules/tests/fixture/modules/issue-7737/issue-7737.css
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,16 @@ | ||
.chain2 { | ||
composes: e from global; | ||
composes: f from "./f.css"; | ||
} | ||
|
||
.chain1 { | ||
composes: chain2; | ||
composes: c from global; | ||
composes: d from "./d.css"; | ||
} | ||
|
||
.root-class { | ||
composes: chain1; | ||
composes: a from global; | ||
composes: b from "./b.css"; | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/swc_css_modules/tests/fixture/modules/issue-7737/issue-7737.imports.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,5 @@ | ||
[ | ||
"./b.css", | ||
"./d.css", | ||
"./f.css" | ||
] |
86 changes: 86 additions & 0 deletions
86
crates/swc_css_modules/tests/fixture/modules/issue-7737/issue-7737.transform.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,86 @@ | ||
{ | ||
"chain2": [ | ||
{ | ||
"type": "local", | ||
"name": "__local__chain2" | ||
}, | ||
{ | ||
"type": "global", | ||
"name": "e" | ||
}, | ||
{ | ||
"type": "import", | ||
"name": "f", | ||
"from": "./f.css" | ||
} | ||
], | ||
"chain1": [ | ||
{ | ||
"type": "local", | ||
"name": "__local__chain1" | ||
}, | ||
{ | ||
"type": "local", | ||
"name": "__local__chain2" | ||
}, | ||
{ | ||
"type": "global", | ||
"name": "c" | ||
}, | ||
{ | ||
"type": "import", | ||
"name": "d", | ||
"from": "./d.css" | ||
}, | ||
{ | ||
"type": "global", | ||
"name": "e" | ||
}, | ||
{ | ||
"type": "import", | ||
"name": "f", | ||
"from": "./f.css" | ||
} | ||
], | ||
"root-class": [ | ||
{ | ||
"type": "local", | ||
"name": "__local__root-class" | ||
}, | ||
{ | ||
"type": "local", | ||
"name": "__local__chain1" | ||
}, | ||
{ | ||
"type": "global", | ||
"name": "a" | ||
}, | ||
{ | ||
"type": "import", | ||
"name": "b", | ||
"from": "./b.css" | ||
}, | ||
{ | ||
"type": "local", | ||
"name": "__local__chain2" | ||
}, | ||
{ | ||
"type": "global", | ||
"name": "c" | ||
}, | ||
{ | ||
"type": "import", | ||
"name": "d", | ||
"from": "./d.css" | ||
}, | ||
{ | ||
"type": "global", | ||
"name": "e" | ||
}, | ||
{ | ||
"type": "import", | ||
"name": "f", | ||
"from": "./f.css" | ||
} | ||
] | ||
} |
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