Skip to content

Merge nested rules and at-rules when merging duplicate selectors - #92

Merged
ai merged 1 commit into
postcss:mainfrom
trackoor:fix/merge-nested-rules
Nov 19, 2026
Merged

ai merged 1 commit into
postcss:mainfrom
trackoor:fix/merge-nested-rules

Conversation

@trackoor

Copy link
Copy Markdown
Contributor

When objectify() merged two rules with the same selector, nested rules and at-rules under the same key replaced the earlier ones, so declarations from the first block were lost. The merge now recurses into nested objects, keeping the existing !important handling, and arrays and plain values are still overwritten as before. Added tests for nested rules and nested at-rules.

Fixes #91

@ai
ai merged commit 2079831 into postcss:main Nov 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

objectify() overwrites nested rules and at-rules when merging duplicate selectors

2 participants