Skip to content

Fix declaration order after @at-root - #181

Open
wozhenbang2004 wants to merge 1 commit into
postcss:mainfrom
wozhenbang2004:fix/at-root-declaration-order
Open

wozhenbang2004 wants to merge 1 commit into
postcss:mainfrom
wozhenbang2004:fix/at-root-declaration-order

Conversation

@wozhenbang2004

Copy link
Copy Markdown

Declarations after @at-root are currently emitted in the original parent rule, ahead of the rule that @at-root hoists. If both rules set the same property on the same selector, this can reverse the cascade.

Reuse the existing declaration handling for hoisted rules so later declarations are emitted after @at-root. Both shorthand and block regressions fail on the unmodified implementation. pnpm test passes all 81 tests with the fix.

@ai

ai commented Nov 5, 2026

Copy link
Copy Markdown
Member

Can you show input, before and after exampes?

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.

2 participants