Repository navigation
test(css-cascade-layers): capture that the next plugins don't process the nodes they insert - #13122
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
⚡️ Lighthouse report for the deploy preview of this PR
|
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
… the nodes they insert Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e6b6428 to
cae1e58
Compare
Motivation
First PR of a bug fix stack: a test capturing how
@docusaurus/plugin-css-cascade-layerscurrently behaves. Found while working on #13088, where rtlcss misses thevar()fallbacks of postcss-preset-env in the wrapped files.When it wraps a file in
@layer, the plugin clones the root and appends the clone's nodes inside a plain{type: 'atrule', nodes}object. PostCSS adopts such an object as-is, without fixing theparentof its children: the wrapped rules still point to the detached clone. When a later plugin inserts a node in them, PostCSS marks the detached clone as dirty, not the real tree, so no plugin visits the new node.The test reproduces it with 2 minimal plugins running after the wrap: one inserts a fallback before a
var()declaration (like postcss-preset-env), the next one flipslefttoright(like rtlcss). The output shows the inserted fallback unflipped:left:1px;right:var(--width).Test Plan
New
postCssPlugin.test.tsunit test. Its inline snapshot shows the current, buggy, output. The next PR fixes it and updates the snapshot.Test links
Deploy preview: https://deploy-preview-13122--docusaurus-2.netlify.app/
🤖 Generated with Claude Code
Summary by CodeRabbit
lefttoright.