-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: bump postcss-nesting v12 to support latest CSS nesting syntax (#…
- Loading branch information
1 parent
411cea2
commit ce24aad
Showing
12 changed files
with
134 additions
and
38 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,8 @@ | ||
--- | ||
'@modern-js/builder-shared': patch | ||
'@modern-js/module-tools': patch | ||
--- | ||
|
||
feat: bump postcss-nesting v12 to support latest CSS nesting syntax | ||
|
||
feat: 升级 postcss-nesting v12,支持最新的 CSS nesting 语法 |
4 changes: 2 additions & 2 deletions
4
packages/builder/builder-shared/compiled/postcss-nesting/index.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
packages/builder/builder-shared/compiled/postcss-nesting/package.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 |
---|---|---|
@@ -1 +1 @@ | ||
{"name":"postcss-nesting","author":"Jonathan Neal <[email protected]>","version":"10.1.4","funding":{"type":"opencollective","url":"https://opencollective.com/csstools"},"license":"CC0-1.0","types":"index.d.ts"} | ||
{"name":"postcss-nesting","version":"12.0.1","funding":[{"type":"github","url":"https://github.com/sponsors/csstools"},{"type":"opencollective","url":"https://opencollective.com/csstools"}],"license":"MIT-0","types":"index.d.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
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
4 changes: 2 additions & 2 deletions
4
packages/solutions/module-tools/compiled/postcss-nesting/index.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
packages/solutions/module-tools/compiled/postcss-nesting/package.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 |
---|---|---|
@@ -1 +1 @@ | ||
{"name":"postcss-nesting","author":"Jonathan Neal <[email protected]>","version":"10.1.4","funding":{"type":"opencollective","url":"https://opencollective.com/csstools"},"license":"CC0-1.0","types":"index.d.ts"} | ||
{"name":"postcss-nesting","version":"12.0.1","funding":[{"type":"github","url":"https://github.com/sponsors/csstools"},{"type":"opencollective","url":"https://opencollective.com/csstools"}],"license":"MIT-0","types":"index.d.ts"} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import path from 'path'; | ||
import { expect, test } from '@modern-js/e2e/playwright'; | ||
import { build } from '@scripts/shared'; | ||
|
||
test('should compile CSS nesting correctly', async () => { | ||
const builder = await build({ | ||
cwd: __dirname, | ||
entry: { index: path.resolve(__dirname, './src/index.js') }, | ||
}); | ||
const files = await builder.unwrapOutputJSON(); | ||
|
||
const content = | ||
files[Object.keys(files).find(file => file.endsWith('.css'))!]; | ||
|
||
expect(content).toEqual( | ||
'.card h1,.card h2,h3 .card{color:red}.card :is(h1){color:blue}.card .foo{font-size:12px}.card .bar{font-size:14px}.card.baz{font-size:16px}.demo:hover{color:green}.demo :hover{color:cyan}.demo .lg .circle,.demo .lg .triangle{opacity:.25}', | ||
); | ||
}); |
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,48 @@ | ||
.card { | ||
h1 { | ||
color: red; | ||
} | ||
|
||
& h2 { | ||
color: red; | ||
} | ||
|
||
h3 & { | ||
color: red; | ||
} | ||
|
||
:is(h1) { | ||
color: blue; | ||
} | ||
|
||
.foo { | ||
font-size: 12px; | ||
} | ||
|
||
& .bar { | ||
font-size: 14px; | ||
} | ||
|
||
&.baz { | ||
font-size: 16px; | ||
} | ||
} | ||
|
||
.demo { | ||
&:hover { | ||
color: green; | ||
} | ||
|
||
:hover { | ||
color: cyan; | ||
} | ||
} | ||
|
||
.demo { | ||
.lg { | ||
.triangle, | ||
.circle { | ||
opacity: 0.25; | ||
} | ||
} | ||
} |
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 @@ | ||
import './a.css'; |