Skip to content

fix #1631 #1632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions plugins/postcss-is-pseudo-class/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes to PostCSS Is Pseudo Class

### Unreleased (patch)

- Fix support for more complex selector patterns. `.a > :is(.b > .c)` -> `.a.b > .c`

### 5.0.2

_June 10, 2025_
Expand Down
2 changes: 1 addition & 1 deletion plugins/postcss-is-pseudo-class/dist/index.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/postcss-is-pseudo-class/dist/index.mjs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export function samePrecedingElement(selector: parser.Container): boolean {
}

const before = selector.nodes.slice(0, combinatorIndex);
const after = selector.nodes.slice(isPseudoIndex + 1);

selector.each((node) => {
node.remove();
Expand All @@ -88,5 +89,9 @@ export function samePrecedingElement(selector: parser.Container): boolean {
selector.append(node);
});

after.forEach((node) => {
selector.append(node);
});

return true;
}
5 changes: 5 additions & 0 deletions plugins/postcss-is-pseudo-class/test/complex.css
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,8 @@ console.log(out.join(''));
.ignore::before + :is(.b + .c) {
order: 78;
}

/* https: //github.com/csstools/postcss-plugins/issues/1631 */
.c > :is(.a > .b) .d::before {
order: 79;
}
5 changes: 5 additions & 0 deletions plugins/postcss-is-pseudo-class/test/complex.expect.css
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,8 @@ console.log(out.join(''));
.ignore::before + :is(.b + .c) {
order: 78;
}

/* https: //github.com/csstools/postcss-plugins/issues/1631 */
.c.a > .b .d::before {
order: 79;
}